Skip to content

Commit

Permalink
test: add testcase #828 and fix testcases
Browse files Browse the repository at this point in the history
  • Loading branch information
sorrycc committed Jan 2, 2024
1 parent 1e3fd01 commit 6334bb6
Show file tree
Hide file tree
Showing 5 changed files with 17 additions and 1 deletion.
2 changes: 1 addition & 1 deletion e2e/fixtures/javascript.legacy-decorator/expect.js
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,6 @@ const names = Object.keys(files).join(",");
const content = files["index.js"];

assert(
content.includes(`Foo = (0, _ts_decorate._)([`),
content.includes(`Foo = _ts_decorate._([`),
"legacy decorator should works"
);
6 changes: 6 additions & 0 deletions e2e/fixtures/javascript.target.ie11/expect.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
const assert = require("assert");
const { parseBuildResult, moduleReg } = require("../../../scripts/test-utils");
const { distDir } = parseBuildResult(__dirname);

const ret = require(path.join(distDir, 'index.js')).default();
assert(ret === 'abc', 'Run dist/index.js does not throw error.');
1 change: 1 addition & 0 deletions e2e/fixtures/javascript.target.ie11/mako.config.json
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
{ "targets": { "ie": 11 }, "umd": true }
4 changes: 4 additions & 0 deletions e2e/fixtures/javascript.target.ie11/src/foo.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
const [a, b] = ['abc', 2];
// 此行是为了在浏览器版本低的时候(比如 ie:11 或 chrome: 20)时添加 helper 方法
typeof b;
exports.a = a;
5 changes: 5 additions & 0 deletions e2e/fixtures/javascript.target.ie11/src/index.tsx
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
import foo from './foo';
console.log(foo.a);
export default () => {
return foo.a;
}

0 comments on commit 6334bb6

Please sign in to comment.