File tree 3 files changed +32
-15
lines changed
3 files changed +32
-15
lines changed Original file line number Diff line number Diff line change 1
- language : node_js
1
+ version : ~> 1.0
2
2
3
- node_js :
4
- - " 12"
5
- - " node"
6
3
7
- sudo : false
8
-
9
- install :
10
- - " npm install"
11
-
12
- os :
13
- - " linux"
14
- - " osx"
15
- - " windows"
4
+ import :
5
+ - hapijs/ci-config-travis:node_js.yml@main
6
+ - hapijs/ci-config-travis:install.yml@main
7
+ - hapijs/ci-config-travis:os.yml@main
Original file line number Diff line number Diff line change @@ -42,10 +42,10 @@ exports.incomplete = function () {
42
42
} ;
43
43
44
44
45
- internals . atNamedRx = / ^ \s * a t [ ^ ( / ] * \( ? ( .+ ) \: ( \d + ) \: ( \d + ) \) ? $ / ;
45
+ internals . atNamedRx = / ^ \s * a t (?: a s y n c ) ? [ ^ ( / ] * \( ? ( .+ ) \: ( \d + ) \: ( \d + ) \) ? $ / ;
46
46
47
47
48
- internals . atUnnamedRx = / ^ \s * a t ( .+ ) \: ( \d + ) \: ( \d + ) \) ? $ / ;
48
+ internals . atUnnamedRx = / ^ \s * a t (?: a s y n c ) ? ( .+ ) \: ( \d + ) \: ( \d + ) \) ? $ / ;
49
49
50
50
51
51
exports . thrownAt = function ( error ) {
Original file line number Diff line number Diff line change @@ -2369,6 +2369,31 @@ describe('expect()', () => {
2369
2369
} ) ;
2370
2370
} ) ;
2371
2371
} ) ;
2372
+
2373
+ it ( 'handles cases where thrownAt() cannot parse the error' , ( ) => {
2374
+
2375
+ const captureStackTrace = Error . captureStackTrace ;
2376
+
2377
+ Error . captureStackTrace = ( error ) => {
2378
+
2379
+ error . stack = 5 ;
2380
+ } ;
2381
+
2382
+ try {
2383
+ Code . expect ( 1 ) . to . equal ( 2 ) ;
2384
+ }
2385
+ catch ( err ) {
2386
+ var exception = err ;
2387
+ }
2388
+ finally {
2389
+ Error . captureStackTrace = captureStackTrace ;
2390
+ }
2391
+
2392
+ Hoek . assert ( exception ) ;
2393
+ Hoek . assert ( exception . message === 'Expected 1 to equal specified value: 2' , exception . message ) ;
2394
+ Hoek . assert ( exception . at . filename === __filename ) ;
2395
+ Hoek . assert ( exception . at . column === '18' ) ;
2396
+ } ) ;
2372
2397
} ) ;
2373
2398
2374
2399
describe ( 'fail' , ( ) => {
You can’t perform that action at this time.
0 commit comments