-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
9 changed files
with
933 additions
and
933 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,7 +1,7 @@ | ||
|
||
export default class MockTestHelper { | ||
static getCallArguments(mock) { | ||
return mock.mock.calls; | ||
} | ||
static getCallArguments(mock) { | ||
return mock.mock.calls; | ||
} | ||
} | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,29 +1,29 @@ | ||
import ValidationError from './ValidationError'; | ||
|
||
describe('ValidationError', () => { | ||
it('constructs an error with the custom message', () => { | ||
const error = new ValidationError('test url', [{dataPath: 'testpath', message: 'testmessage'}], 'test schema'); | ||
function toString() { | ||
return ValidationError.prototype.toString.apply(error); | ||
} | ||
it('constructs an error with the custom message', () => { | ||
const error = new ValidationError('test url', [{dataPath: 'testpath', message: 'testmessage'}], 'test schema'); | ||
function toString() { | ||
return ValidationError.prototype.toString.apply(error); | ||
} | ||
|
||
expect(error.message).toEqual(`[ | ||
expect(error.message).toEqual(`[ | ||
"<test url> testpath: testmessage" | ||
]`); | ||
|
||
expect(toString()).toEqual(`ValidationError: [ | ||
expect(toString()).toEqual(`ValidationError: [ | ||
"<test url> testpath: testmessage" | ||
]`); | ||
}); | ||
}); | ||
|
||
it('works when no constructor value passed in', () => { | ||
const error = new ValidationError(); | ||
function toString() { | ||
return ValidationError.prototype.toString.apply(error); | ||
} | ||
it('works when no constructor value passed in', () => { | ||
const error = new ValidationError(); | ||
function toString() { | ||
return ValidationError.prototype.toString.apply(error); | ||
} | ||
|
||
expect(error.message).toEqual(`[]`); | ||
expect(error.message).toEqual(`[]`); | ||
|
||
expect(toString()).toEqual(`ValidationError: []`); | ||
}); | ||
expect(toString()).toEqual(`ValidationError: []`); | ||
}); | ||
}); |
Oops, something went wrong.