You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I am unable to run test with respondImmediately : false server configuration - even for simple test case from documentation.
From test from documentation
it('resolves request after respond()',function(){// given:constserver=http({autoRespond: true,respondImmediately: false});constapp=test(MyModule);server.get('/greeting',req=>req.sendStatus(200));// when:constcomp=app.run(MyComponent);comp.verify(expectThat.textOf('.greeting').isEqualTo('Waiting for server response!'));comp.perform(server.respond);comp.verify(expectThat.textOf('.greeting').isEqualTo('Hello from server!'));});
I'm getting an error:
Error: INVALID_STATE_ERR - 0
at verifyRequestOpened (http://localhost:9876/_karma_webpack_/webpack:/Users/krzysztof/Workspace/ng-test-runner/node_modules/nise/nise.js:762:1)
The text was updated successfully, but these errors were encountered:
I started looking into that. It looks like the error is in our code that prepares response from sinon
Example, I'm waiting for response with body that is simple json with attribute message. I've modified the "method" method in server.ts to use sinon like so:
In following example that uses only sinon and Angular (without ng-test-runner) first test (sinon respondWith with function) fails, but second (sinon respondWith with body) works fine.
I am unable to run test with
respondImmediately : false
server configuration - even for simple test case from documentation.From test from documentation
I'm getting an error:
The text was updated successfully, but these errors were encountered: