File tree 2 files changed +12
-3
lines changed
2 files changed +12
-3
lines changed Original file line number Diff line number Diff line change 1
1
2
+ 1.5.1 / 2017-09-07
3
+ ==================
4
+
5
+ * Package: Added new keywords (@thebigredgeek )
6
+ * Docs: Updated docs to reference [ apollo-server] ( https://dev.apollodata.com/tools/apollo-server/setup.html ) (@thebigredgeek )
7
+
2
8
1.5.0 / 2017-08-29
3
9
==================
4
10
Original file line number Diff line number Diff line change 1
1
import { expect } from 'chai' ;
2
+ import assert from 'assert' ;
2
3
3
4
import { createError , formatError } from '../dist' ;
4
5
6
+ const { AssertionError } = assert ;
7
+
5
8
describe ( 'createError' , ( ) => {
6
9
context ( 'when properly used' , ( ) => {
7
10
it ( 'returns an error that serializes properly' , ( ) => {
@@ -46,7 +49,7 @@ describe('createError', () => {
46
49
createError ( 'FooError' ) ;
47
50
throw new Error ( 'did not throw as expected' ) ;
48
51
} catch ( err ) {
49
- expect ( err . name ) . to . equal ( 'AssertionError [ERR_ASSERTION]' ) ;
52
+ expect ( err instanceof AssertionError ) . to . be . true ;
50
53
expect ( err . message ) . to . equal ( 'createError requires a config object as the second parameter' ) ;
51
54
}
52
55
} ) ;
@@ -55,11 +58,11 @@ describe('createError', () => {
55
58
it ( 'throws an assertion error with a useful message' , ( ) => {
56
59
try {
57
60
createError ( 'FooError' , {
58
-
61
+
59
62
} ) ;
60
63
throw new Error ( 'did not throw as expected' ) ;
61
64
} catch ( err ) {
62
- expect ( err . name ) . to . equal ( 'AssertionError [ERR_ASSERTION]' ) ;
65
+ expect ( err instanceof AssertionError ) . to . be . true ;
63
66
expect ( err . message ) . to . equal ( 'createError requires a "message" property on the config object passed as the second parameter' )
64
67
}
65
68
} ) ;
You can’t perform that action at this time.
0 commit comments