mirror of
https://github.com/game-ci/unity-builder.git
synced 2026-02-04 08:09:08 +08:00
Add tests for the versioning model
This commit is contained in:
@@ -1,9 +1,25 @@
|
||||
expect.extend({
|
||||
toBeOfType(received, expectedType) {
|
||||
const type = typeof received;
|
||||
|
||||
const pass = type === expectedType;
|
||||
const message = () => `
|
||||
Expected value to be of type ${this.utils.printExpected(expectedType)},
|
||||
but received ${this.utils.printReceived(type)}`;
|
||||
|
||||
return {
|
||||
message,
|
||||
pass,
|
||||
};
|
||||
},
|
||||
|
||||
toBeEitherAFunctionOrAnObject(received) {
|
||||
const type = typeof received;
|
||||
|
||||
const pass = ['object', 'function'].includes(type);
|
||||
const message = `Expected a function or an object, received ${type}`;
|
||||
const message = () => `Expected a ${this.utils.printExpected('function')}
|
||||
or an ${this.utils.printExpected('object')},
|
||||
but received ${type}`;
|
||||
|
||||
return {
|
||||
message,
|
||||
@@ -11,5 +27,3 @@ expect.extend({
|
||||
};
|
||||
},
|
||||
});
|
||||
|
||||
jest.mock('./model/input');
|
||||
|
||||
Reference in New Issue
Block a user