File tree Expand file tree Collapse file tree 2 files changed +12
-3
lines changed Expand file tree Collapse file tree 2 files changed +12
-3
lines changed Original file line number Diff line number Diff line change 11
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+
281.5.0 / 2017-08-29
39==================
410
Original file line number Diff line number Diff line change 11import { expect } from 'chai' ;
2+ import assert from 'assert' ;
23
34import { createError , formatError } from '../dist' ;
45
6+ const { AssertionError } = assert ;
7+
58describe ( 'createError' , ( ) => {
69 context ( 'when properly used' , ( ) => {
710 it ( 'returns an error that serializes properly' , ( ) => {
@@ -46,7 +49,7 @@ describe('createError', () => {
4649 createError ( 'FooError' ) ;
4750 throw new Error ( 'did not throw as expected' ) ;
4851 } catch ( err ) {
49- expect ( err . name ) . to . equal ( 'AssertionError [ERR_ASSERTION]' ) ;
52+ expect ( err instanceof AssertionError ) . to . be . true ;
5053 expect ( err . message ) . to . equal ( 'createError requires a config object as the second parameter' ) ;
5154 }
5255 } ) ;
@@ -55,11 +58,11 @@ describe('createError', () => {
5558 it ( 'throws an assertion error with a useful message' , ( ) => {
5659 try {
5760 createError ( 'FooError' , {
58-
61+
5962 } ) ;
6063 throw new Error ( 'did not throw as expected' ) ;
6164 } catch ( err ) {
62- expect ( err . name ) . to . equal ( 'AssertionError [ERR_ASSERTION]' ) ;
65+ expect ( err instanceof AssertionError ) . to . be . true ;
6366 expect ( err . message ) . to . equal ( 'createError requires a "message" property on the config object passed as the second parameter' )
6467 }
6568 } ) ;
You can’t perform that action at this time.
0 commit comments