I have a weird behaviour when running tests with ember t
in the Terminal, - there is one that fails with:
Testem finished with non-zero exit code. Tests failed.
not ok 9 Chrome - [undefined ms] - error
---
message: >
Error: Browser exited unexpectedly
Error while executing test: Acceptance | Address: Authenticated users can visit /address
Non-zero exit code: null
Stderr:
DevTools listening on ws://127.0.0.1:51916/devtools/browser/f31a18cc-452c-4de2-a3b2-dbfc50865f72
[0809/114553.464989:WARNING:system_snapshot_mac.cc(42)] sysctlbyname kern.nx: No such file or directory (2)
[0809/114553.478836:WARNING:gpu_process_host.cc(1188)] The GPU process has crashed 1 time(s)
...
There is much more output, I just dropped it for easier reading. The most surprising is to see:
'kern.nx: No such file or directory (2)\n'
...
When I run the same tests but with --server
option, they pass all.
When I add await pauseTest();
to the failing test, start ember s
and try just to navigate to http://localhost:4200/tests
as explained in Ember Guides - Testing section, I get the below errors in the browser console:
The test itself has nothing special and passed before:
import { module, test } from 'qunit';
import { visit, currentURL } from '@ember/test-helpers';
import { setupApplicationTest } from 'ember-qunit';
import { authenticateSession } from 'ember-simple-auth/test-support';
import setupMirageTest from 'ember-cli-mirage/test-support/setup-mirage';
import { setupWindowMock } from 'ember-window-mock';
module('Acceptance | Address', function(hooks) {
setupWindowMock(hooks);
setupApplicationTest(hooks);
setupMirageTest(hooks);
test('Authenticated users can visit /address', async function(assert) {
let shop = server.create('shop');
server.create('user', { shop });
server.create('address', { shop });
await authenticateSession({
access_token: 'azerty',
token_type: 'Bearer'
});
await pauseTest();
await visit('/address');
assert.equal(currentURL(), '/address', 'user is on the Address page');
});
});
Even if I comment out all the acceptance tests with skip
, all the other unit tests fail as well with the same error:
Log: |
{ type: 'error', text: 'Error: Browser exited unexpectedly' }
{
type: 'error',
text: 'Error while executing test: Unit | Model | shop: should have a country'
}
{ type: 'error', text: 'Non-zero exit code: null' }
What’s wrong with that? I didn’t make any code nor settings changes.
Thank you.