diff --git a/tests/fixture/issue-2351/1/input/.swcrc b/tests/fixture/issue-2351/1/input/.swcrc new file mode 100644 index 00000000000..77fb46ac78f --- /dev/null +++ b/tests/fixture/issue-2351/1/input/.swcrc @@ -0,0 +1,8 @@ +{ + "jsc": { + "parser": { + "syntax": "ecmascript", + "jsx": true + } + } +} \ No newline at end of file diff --git a/tests/fixture/issue-2351/1/input/index.js b/tests/fixture/issue-2351/1/input/index.js new file mode 100644 index 00000000000..ca877e324d4 --- /dev/null +++ b/tests/fixture/issue-2351/1/input/index.js @@ -0,0 +1 @@ +const a = \d; diff --git a/tests/fixture/issue-2351/1/output/index.js b/tests/fixture/issue-2351/1/output/index.js new file mode 100644 index 00000000000..a82f31bd16e --- /dev/null +++ b/tests/fixture/issue-2351/1/output/index.js @@ -0,0 +1,3 @@ +var a = /*#__PURE__*/ React.createElement("abbr", { + title: "d" +}, "\\d"); diff --git a/tests/fixture/issue-2372/input/.swcrc b/tests/fixture/issue-2372/input/.swcrc new file mode 100644 index 00000000000..b58d23a12fd --- /dev/null +++ b/tests/fixture/issue-2372/input/.swcrc @@ -0,0 +1,40 @@ +[ + { + "env": { + "targets": { + "node": "12.19.0" + } + }, + "jsc": { + "parser": { + "dynamicImport": true, + "syntax": "typescript", + "tsx": false + }, + "target": "es2015" + }, + "module": { + "type": "commonjs" + }, + "sourceMaps": true, + "test": ".*.ts$" + }, + { + "env": { + "targets": { + "node": "12.19.0" + } + }, + "jsc": { + "parser": { + "dynamicImport": true, + "syntax": "ecmascript" + }, + "target": "es2015" + }, + "module": { + "type": "commonjs" + }, + "test": ".*.js$" + } +] \ No newline at end of file diff --git a/tests/fixture/issue-2372/input/index.js b/tests/fixture/issue-2372/input/index.js new file mode 100644 index 00000000000..61bbbe15b22 --- /dev/null +++ b/tests/fixture/issue-2372/input/index.js @@ -0,0 +1,11 @@ +import { sum } from './'; + +describe('example test that should fail due to compilation', () => { + test.each([ + ['a', 1, 1, 2], + ['b', 2, 2, 4], + ])('for entry %s', (_, a, b, expected) => { + const result = sum(a, b); + expect(result).toEqual(expected); + }); +}); \ No newline at end of file diff --git a/tests/fixture/issue-2372/output/index.js b/tests/fixture/issue-2372/output/index.js new file mode 100644 index 00000000000..9e94f45f26b --- /dev/null +++ b/tests/fixture/issue-2372/output/index.js @@ -0,0 +1,21 @@ +"use strict"; +var _1 = require("./"); +describe('example test that should fail due to compilation', ()=>{ + test.each([ + [ + 'a', + 1, + 1, + 2 + ], + [ + 'b', + 2, + 2, + 4 + ], + ])('for entry %s', (_, a, b, expected)=>{ + const result = (0, _1).sum(a, b); + expect(result).toEqual(expected); + }); +});