mirror of
https://github.com/swc-project/swc.git
synced 2024-12-25 22:56:11 +03:00
test(es): Add tests for fixed issues (#3874)
This commit is contained in:
parent
cd06b0d354
commit
2605e132e6
15
crates/swc/tests/fixture/issue-2423/input/.swcrc
Normal file
15
crates/swc/tests/fixture/issue-2423/input/.swcrc
Normal file
@ -0,0 +1,15 @@
|
||||
{
|
||||
"module": {
|
||||
"type": "commonjs"
|
||||
},
|
||||
"exclude": [
|
||||
".*.js$"
|
||||
],
|
||||
"jsc": {
|
||||
"parser": {
|
||||
"syntax": "typescript"
|
||||
},
|
||||
"target": "es2016"
|
||||
},
|
||||
"sourceMaps": true
|
||||
}
|
6
crates/swc/tests/fixture/issue-2423/input/index.ts
Normal file
6
crates/swc/tests/fixture/issue-2423/input/index.ts
Normal file
@ -0,0 +1,6 @@
|
||||
namespace A {
|
||||
export const v = 25;
|
||||
export function a() {
|
||||
console.log(v);
|
||||
}
|
||||
}
|
17
crates/swc/tests/fixture/issue-2423/output/index.map
Normal file
17
crates/swc/tests/fixture/issue-2423/output/index.map
Normal file
@ -0,0 +1,17 @@
|
||||
{
|
||||
"mappings": "Y;AAAA,GAAS;;QACQA,CAAC,MAADA,CAAC,GAAG,EAAE;aACHC,CAAC,GAAG,CAAC;QACjBC,OAAO,CAACC,GAAG,CAACH,CAAC,CAAC,CAAC;IACnB,CAAC;OAFeC,CAAC,GAADA,CAAC,A;GAFXG,CAAC,KAADA,CAAC,O",
|
||||
"names": [
|
||||
"v",
|
||||
"a",
|
||||
"console",
|
||||
"log",
|
||||
"A"
|
||||
],
|
||||
"sources": [
|
||||
"../../input/index.ts"
|
||||
],
|
||||
"sourcesContent": [
|
||||
"namespace A {\n export const v = 25;\n export function a() {\n console.log(v);\n }\n}"
|
||||
],
|
||||
"version": 3
|
||||
}
|
9
crates/swc/tests/fixture/issue-2423/output/index.ts
Normal file
9
crates/swc/tests/fixture/issue-2423/output/index.ts
Normal file
@ -0,0 +1,9 @@
|
||||
"use strict";
|
||||
var A;
|
||||
(function(A1) {
|
||||
var v = A1.v = 25;
|
||||
function a() {
|
||||
console.log(v);
|
||||
}
|
||||
A1.a = a;
|
||||
})(A || (A = {}));
|
18
crates/swc/tests/fixture/issue-2636/input/.swcrc
Normal file
18
crates/swc/tests/fixture/issue-2636/input/.swcrc
Normal file
@ -0,0 +1,18 @@
|
||||
{
|
||||
"jsc": {
|
||||
"parser": {
|
||||
"syntax": "typescript",
|
||||
"tsx": false
|
||||
},
|
||||
"target": "es5",
|
||||
"loose": false,
|
||||
"minify": {
|
||||
"compress": false,
|
||||
"mangle": false
|
||||
}
|
||||
},
|
||||
"module": {
|
||||
"type": "es6"
|
||||
},
|
||||
"minify": false
|
||||
}
|
5
crates/swc/tests/fixture/issue-2636/input/index.ts
Normal file
5
crates/swc/tests/fixture/issue-2636/input/index.ts
Normal file
@ -0,0 +1,5 @@
|
||||
export module RuleInterpreterHelper {
|
||||
export const fieldNameMap: [string, string][] = [];
|
||||
|
||||
export const fieldNameHashMap: Map<string, string> = new Map(fieldNameMap);
|
||||
}
|
5
crates/swc/tests/fixture/issue-2636/output/index.ts
Normal file
5
crates/swc/tests/fixture/issue-2636/output/index.ts
Normal file
@ -0,0 +1,5 @@
|
||||
export var RuleInterpreterHelper;
|
||||
(function(RuleInterpreterHelper1) {
|
||||
var fieldNameMap = RuleInterpreterHelper1.fieldNameMap = [];
|
||||
var fieldNameHashMap = RuleInterpreterHelper1.fieldNameHashMap = new Map(fieldNameMap);
|
||||
})(RuleInterpreterHelper || (RuleInterpreterHelper = {}));
|
Loading…
Reference in New Issue
Block a user