зеркало из https://github.com/mozilla/gecko-dev.git
Bug 1586189 - Provide useful assertion messages. r=ttung
Differential Revision: https://phabricator.services.mozilla.com/D48712 --HG-- extra : moz-landing-system : lando
This commit is contained in:
Родитель
05480d5b8b
Коммит
49db1f8c5f
|
@ -71,8 +71,14 @@
|
|||
// eslint-disable-next-line no-eval
|
||||
let message = eval(event.data);
|
||||
|
||||
is(message.source, "iframe", "Good source");
|
||||
is(message.result, testData[testIndex].expectedResult, "Good result");
|
||||
// TODO: This is an ad-hoc solution to get a useful assertion message.
|
||||
// It would be desirable that the test framework provides the ability
|
||||
// to capture context information and provide it on assertion failures,
|
||||
// automatically stringified.
|
||||
let testContext = `testData[${testIndex}] == ${JSON.stringify(testData[testIndex])}`;
|
||||
|
||||
is(message.source, "iframe", `Good source for ${testContext}`);
|
||||
is(message.result, testData[testIndex].expectedResult, `Good result for ${testContext}`);
|
||||
|
||||
openedWindow.close();
|
||||
|
||||
|
|
Загрузка…
Ссылка в новой задаче