Skip to content

Commit

Permalink
test: tweak lib helpers inject to test "use strict" (#14452)
Browse files Browse the repository at this point in the history
  • Loading branch information
sapphi-red committed Sep 25, 2023
1 parent b77bff0 commit 669a38d
Showing 1 changed file with 2 additions and 4 deletions.
6 changes: 2 additions & 4 deletions playground/lib/__tests__/lib.spec.ts
Original file line number Diff line number Diff line change
Expand Up @@ -33,11 +33,9 @@ describe.runIf(isBuild)('build', () => {
'dist/nominify/my-lib-custom-filename.iife.js',
)
// esbuild helpers are injected inside of the IIFE wrapper
// esbuild has a bug that injects some statements before `"use strict"`: https://github.com/evanw/esbuild/issues/3322
// remove the `.*?` part once it's fixed
expect(code).toMatch(/^var MyLib=function\(\)\{.*?"use strict";/)
expect(code).toMatch(/^var MyLib=function\(\)\{\s*"use strict";/)
expect(noMinifyCode).toMatch(
/^var MyLib\s*=\s*function\(\)\s*\{.*?"use strict";/s,
/^var MyLib\s*=\s*function\(\)\s*\{\s*"use strict";/,
)
})

Expand Down

0 comments on commit 669a38d

Please sign in to comment.