Skip to content

Commit

Permalink
Update tests
Browse files Browse the repository at this point in the history
  • Loading branch information
sirreal committed May 9, 2024
1 parent fc21aa3 commit 59daff2
Showing 1 changed file with 11 additions and 11 deletions.
22 changes: 11 additions & 11 deletions packages/warning/test/babel-plugin.js
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@ describe( 'babel-plugin', () => {
);
const expected = join(
'import warning from "@wordpress/warning";',
'typeof SCRIPT_DEBUG !== "undefined" && SCRIPT_DEBUG === true ? warning("a") : void 0;'
'globalThis.SCRIPT_DEBUG === true ? warning("a") : void 0;'
);

expect( transformCode( input ) ).toEqual( expected );
Expand All @@ -45,7 +45,7 @@ describe( 'babel-plugin', () => {
const input = 'warning("a");';
const options = { callee: 'warning' };
const expected =
'typeof SCRIPT_DEBUG !== "undefined" && SCRIPT_DEBUG === true ? warning("a") : void 0;';
'globalThis.SCRIPT_DEBUG === true ? warning("a") : void 0;';

expect( transformCode( input, options ) ).toEqual( expected );
} );
Expand All @@ -59,9 +59,9 @@ describe( 'babel-plugin', () => {
);
const expected = join(
'import warning from "@wordpress/warning";',
'typeof SCRIPT_DEBUG !== "undefined" && SCRIPT_DEBUG === true ? warning("a") : void 0;',
'typeof SCRIPT_DEBUG !== "undefined" && SCRIPT_DEBUG === true ? warning("b") : void 0;',
'typeof SCRIPT_DEBUG !== "undefined" && SCRIPT_DEBUG === true ? warning("c") : void 0;'
'globalThis.SCRIPT_DEBUG === true ? warning("a") : void 0;',
'globalThis.SCRIPT_DEBUG === true ? warning("b") : void 0;',
'globalThis.SCRIPT_DEBUG === true ? warning("c") : void 0;'
);

expect( transformCode( input ) ).toEqual( expected );
Expand All @@ -76,9 +76,9 @@ describe( 'babel-plugin', () => {
);
const expected = join(
'import warn from "@wordpress/warning";',
'typeof SCRIPT_DEBUG !== "undefined" && SCRIPT_DEBUG === true ? warn("a") : void 0;',
'typeof SCRIPT_DEBUG !== "undefined" && SCRIPT_DEBUG === true ? warn("b") : void 0;',
'typeof SCRIPT_DEBUG !== "undefined" && SCRIPT_DEBUG === true ? warn("c") : void 0;'
'globalThis.SCRIPT_DEBUG === true ? warn("a") : void 0;',
'globalThis.SCRIPT_DEBUG === true ? warn("b") : void 0;',
'globalThis.SCRIPT_DEBUG === true ? warn("c") : void 0;'
);

expect( transformCode( input ) ).toEqual( expected );
Expand All @@ -93,9 +93,9 @@ describe( 'babel-plugin', () => {
);
const expected = join(
'import warn from "@wordpress/warning";',
'typeof SCRIPT_DEBUG !== "undefined" && SCRIPT_DEBUG === true ? warn("a") : void 0;',
'typeof SCRIPT_DEBUG !== "undefined" && SCRIPT_DEBUG === true ? warn("b") : void 0;',
'typeof SCRIPT_DEBUG !== "undefined" && SCRIPT_DEBUG === true ? warn("c") : void 0;'
'globalThis.SCRIPT_DEBUG === true ? warn("a") : void 0;',
'globalThis.SCRIPT_DEBUG === true ? warn("b") : void 0;',
'globalThis.SCRIPT_DEBUG === true ? warn("c") : void 0;'
);

expect( transformCode( input ) ).toEqual( expected );
Expand Down

0 comments on commit 59daff2

Please sign in to comment.