Migrate browser transform and core tests for Web Test Runner #1299
Conversation
| // karma doesn't unload the browser between tests, so the onerror handler | ||
| // will remain installed. Unset captureUncaught so the onerror handler | ||
| // won't affect other tests. | ||
| rollbar.configure({ | ||
| captureUncaught: false, | ||
| }); |
There was a problem hiding this comment.
This may not be needed anymore, but will remove in a separate PR.
| captureUncaught: false, | ||
| }); | ||
| expect(body.data.body.trace.exception.message).to.eql('anon error'); | ||
| expect(body.data.notifier.diagnostic.is_anonymous).to.eql(true); |
There was a problem hiding this comment.
These should be modernized to use Chai 5 syntax, instead of to.eql(true) -> to.be.true but isn't priority. Some other syntax changes are necessary, tho since they change behavior between 4 and 5, and also add extra checks.
|
|
||
| var element = document.getElementById('throw-error'); | ||
| const element = document.getElementById('throw-error'); | ||
| expect(element).to.exist; |
There was a problem hiding this comment.
New sanity checks, these weren't working before due to html not being loaded correctly.
|
|
||
| server.requests.length = 0; | ||
| expect(body.data.body.trace.exception.message).to.eql('test error'); | ||
| expect(body.data.notifier.diagnostic.is_anonymous).to.be.undefined; |
There was a problem hiding this comment.
to.not.be.ok ≠ to.be.undefined. Chai 5 adds more precise checks for these situations.
| @@ -1,5 +1,5 @@ | |||
| import { expect } from 'chai'; | |||
| import sinon from 'sinon'; | |||
|
|
|||
There was a problem hiding this comment.
This test file worked after upgrading the error-stack-parser library some time ago without extra changes.
* Initial Karma to Web Test Runner migration (#1289) * Fix hanging tests and expand WTR migration (#1295) * Migrate example tests for Web Test Runner (#1298) * Migrate browser transform and core tests for Web Test Runner (#1299) * Migrate browser tests from Karma to Web Test Runner (#1300) * Initial migration of react native tests (#1301) * Remove Grunt and Karma (#1302)

Caution
This PR is being merged into a feature branch:
matux/wtr.Note
Multiple comments in the diff with details/reasoning about specific changes.
Description of the change
This pull request makes minor updates to the test configuration and imports. The main changes involve cleaning up unused imports and adjusting which test files are excluded from the test runner configuration.
Test configuration updates:
test/browser.transforms.test.jsandtest/browser.core.test.jsfrom the list of excluded test files inweb-test-runner.config.mjs, allowing these tests to run again.Code cleanup:
sinonimport fromtest/browser.transforms.test.js.Related issues
SDK-493/replace-karma-with-webtest-runner-for-modern-performant-browser