11/**
22 * Copyright (c) 2014-present, Facebook, Inc. All rights reserved.
33 *
4- * This source code is licensed under the BSD-style license found in the
5- * LICENSE file in the root directory of this source tree. An additional grant
6- * of patent rights can be found in the PATENTS file in the same directory.
4+ * This source code is licensed under the MIT license found in the
5+ * LICENSE file in the root directory of this source tree.
76 *
87 * @emails oncall+jsinfra
98 */
@@ -17,9 +16,10 @@ describe('Runtime', () => {
1716 } ) ;
1817
1918 describe ( 'requireModule' , ( ) => {
20- it ( 'installs source maps if available' , ( ) =>
21- createRuntime ( __filename ) . then ( runtime => {
22- let hasThrown = false ;
19+ it ( 'installs source maps if available' , ( ) => {
20+ expect . assertions ( 1 ) ;
21+
22+ return createRuntime ( __filename ) . then ( runtime => {
2323 const sum = runtime . requireModule (
2424 runtime . __mockRootPath ,
2525 './sourcemaps/out/throwing-mapped-fn.js' ,
@@ -28,20 +28,17 @@ describe('Runtime', () => {
2828 try {
2929 sum ( ) ;
3030 } catch ( err ) {
31- hasThrown = true ;
32- /* eslint-disable max-len */
3331 if ( process . platform === 'win32' ) {
3432 expect ( err . stack ) . toMatch (
35- / ^ E r r o r : t h r o w i n g f n \s + a t s u m .+ \\ _ _ t e s t s _ _ \\ t e s t _ r o o t \\ s o u r c e m a p s \\ t h r o w i n g - m a p p e d - f n .j s : 1 0 : 9 / ,
33+ / ^ E r r o r : t h r o w i n g f n \s + a t s u m .+ \\ _ _ t e s t s _ _ \\ t e s t _ r o o t \\ s o u r c e m a p s \\ ( o u t \\ ) ? t h r o w i n g - m a p p e d - f n .j s : \d + : \d + / ,
3634 ) ;
3735 } else {
3836 expect ( err . stack ) . toMatch (
39- / ^ E r r o r : t h r o w i n g f n \s + a t s u m .+ \/ _ _ t e s t s _ _ \/ t e s t _ r o o t \/ s o u r c e m a p s \/ t h r o w i n g - m a p p e d - f n .j s : 1 0 : 9 / ,
37+ / ^ E r r o r : t h r o w i n g f n \s + a t s u m .+ \/ _ _ t e s t s _ _ \/ t e s t _ r o o t \/ s o u r c e m a p s \/ ( o u t \/ ) ? t h r o w i n g - m a p p e d - f n .j s : \d + : \d + / ,
4038 ) ;
4139 }
42- /* eslint-enable max-len */
4340 }
44- expect ( hasThrown ) . toBe ( true ) ;
45- } ) ) ;
41+ } ) ;
42+ } ) ;
4643 } ) ;
4744} ) ;
0 commit comments