Skip to content

Commit

Permalink
QUnit mock object for testing. Add propEqual to the global namespace.
Browse files Browse the repository at this point in the history
  • Loading branch information
ronyeh committed Jul 31, 2021
1 parent 41c3de4 commit 421e348
Showing 1 changed file with 5 additions and 10 deletions.
15 changes: 5 additions & 10 deletions tests/vexflow_test_helpers.ts
Original file line number Diff line number Diff line change
Expand Up @@ -95,6 +95,7 @@ if (!global.QUnit) {
notDeepEqual: () => true,
strictEqual: () => true,
notStrictEqual: () => true,
propEqual: () => true,
test: { module: { name: '' } },
},

Expand All @@ -113,16 +114,10 @@ if (!global.QUnit) {

global.QUnit = QUMock;
global.test = QUMock.test;
global.ok = QUMock.assertions.ok;
global.equal = QUMock.assertions.equal;
global.deepEqual = QUMock.assertions.deepEqual;
global.expect = QUMock.assertions.expect;
global.throws = QUMock.assertions.throws;
global.notOk = QUMock.assertions.notOk;
global.notEqual = QUMock.assertions.notEqual;
global.notDeepEqual = QUMock.assertions.notDeepEqual;
global.strictEqual = QUMock.assertions.strictEqual;
global.notStrictEqual = QUMock.assertions.notStrictEqual;
// Make all methods & properties of QUMock.assertions global.
for (const k in QUMock.assertions) {
global[k] = QUMock.assertions[k];
}
}

export type TestFunction = (options: TestOptions, contextBuilder: ContextBuilder) => void;
Expand Down

0 comments on commit 421e348

Please sign in to comment.