Skip to content

Commit

Permalink
Merge pull request #453 from scalvert/use-test-isolation-primatives
Browse files Browse the repository at this point in the history
Converting ember-qunit to use test isolation primatives from @ember/test-helpers
  • Loading branch information
rwjblue committed Feb 25, 2019
2 parents f0fe364 + 00e1874 commit 8084f53
Show file tree
Hide file tree
Showing 6 changed files with 8 additions and 468 deletions.
133 changes: 0 additions & 133 deletions addon-test-support/ember-qunit/-internal/test-debug-info.js

This file was deleted.

13 changes: 7 additions & 6 deletions addon-test-support/ember-qunit/test-isolation-validation.js
Original file line number Diff line number Diff line change
@@ -1,7 +1,8 @@
/* eslint-disable no-console */
import QUnit from 'qunit';
import { run } from '@ember/runloop';
import { waitUntil, isSettled, getSettledState } from '@ember/test-helpers';
import TestDebugInfo, { getDebugInfo } from './-internal/test-debug-info';
import { getDebugInfo } from '@ember/test-helpers';

/**
* Detects if a specific test isn't isolated. A test is considered
Expand All @@ -19,16 +20,16 @@ import TestDebugInfo, { getDebugInfo } from './-internal/test-debug-info';
*/
export function detectIfTestNotIsolated(test, message = '') {
if (!isSettled()) {
let testDebugInfo;
let { debugInfo } = getSettledState();

testDebugInfo = new TestDebugInfo(test.module.name, test.testName, getSettledState());

testDebugInfo.toConsole();
console.group(`${test.module.name}: ${test.testName}`);
debugInfo.toConsole();
console.groupEnd();

test.expected++;
test.assert.pushResult({
result: false,
message: `${message} ${testDebugInfo.message}`,
message: `${message} ${debugInfo.message}`,
});
}
}
Expand Down
Loading

0 comments on commit 8084f53

Please sign in to comment.