Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Ng Test Example? #17

Open
TylerOrtiz opened this issue Jun 29, 2018 · 0 comments
Open

Ng Test Example? #17

TylerOrtiz opened this issue Jun 29, 2018 · 0 comments

Comments

@TylerOrtiz
Copy link

Is there an example in here for running an Angular unit test?

I tried adding the BreezeBridgeHttpClientModule to the imports of the testbed but the test seems to be trying to initiate real requests rather than mocking them.
Test fixture snippet:

 beforeEach(async(() => {
        TestBed.configureTestingModule({
            imports: [FormsModule, HttpClientModule, RouterTestingModule, BreezeBridgeHttpClientModule],
            declarations: [SearchResultsComponent]
        })
        .compileComponents();
    }));

Test result snippet:

Failed: Uncaught (in promise): Error: Metadata query failed for: service/Metadata; NOT FOUND
Error: Metadata query failed for: service/Metadata; NOT FOUND
    at createError (http://localhost:9876/_karma_webpack_/webpack:/node_modules/breeze-client/breeze.debug.js:16247:1)
    at handleHttpError (http://localhost:9876/_karma_webpack_/webpack:/node_modules/breeze-client/breeze.debug.js:16237:1)
    at Object.error (http://localhost:9876/_karma_webpack_/webpack:/node_modules/breeze-client/breeze.debug.js:16036:1)
    at SafeSubscriber.errorFn [as _error] (http://localhost:9876/_karma_webpack_/webpack:/node_modules/breeze-bridge2-angular/index.js:172:1)
    at SafeSubscriber.push../node_modules/rxjs/_esm5/internal/Subscriber.js.SafeSubscriber.__tryOrUnsub (http://localhost:9876/_karma_webpack_/webpack:/node_modules/rxjs/_esm5/internal/Subscriber.js:195:1)
    at SafeSubscriber.push../node_modules/rxjs/_esm5/internal/Subscriber.js.SafeSubscriber.error (http://localhost:9876/_karma_webpack_/webpack:/node_modules/rxjs/_esm5/internal/Subscriber.js:146:1)
    at Subscriber.push../node_modules/rxjs/_esm5/internal/Subscriber.js.Subscriber._error (http://localhost:9876/_karma_webpack_/webpack:/node_modules/rxjs/_esm5/internal/Subscriber.js:80:1)
    at Subscriber.push../node_modules/rxjs/_esm5/internal/Subscriber.js.Subscriber.error (http://localhost:9876/_karma_webpack_/webpack:/node_modules/rxjs/_esm5/internal/Subscriber.js:60:1)
    at MapSubscriber.push../node_modules/rxjs/_esm5/internal/Subscriber.js.Subscriber._error (http://localhost:9876/_karma_webpack_/webpack:/node_modules/rxjs/_esm5/internal/Subscriber.js:80:1)
    at MapSubscriber.push../node_modules/rxjs/_esm5/internal/Subscriber.js.Subscriber.error (http://localhost:9876/_karma_webpack_/webpack:/node_modules/rxjs/_esm5/internal/Subscriber.js:60:1)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant