-
-
Notifications
You must be signed in to change notification settings - Fork 1.2k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
**Description:** This implements something similar to `__snapshots__` of `jest`. Instead of storing the expected result as a string literal, we now store it in `$crate/tests/__swc_snapshots__/$path_to_test__$test_name.js`. **Related issue:** - Closes #4509
- Loading branch information
Showing
1,177 changed files
with
12,268 additions
and
17,684 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
10 changes: 10 additions & 0 deletions
10
...ecma_compat_bugfixes/tests/__swc_snapshots__/src/async_arrows_in_class.rs/async_arrows.js
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,10 @@ | ||
class Foo { | ||
constructor(){ | ||
this.x = async function() { | ||
return await 1; | ||
}; | ||
} | ||
bar() { | ||
(async function() {})(); | ||
} | ||
} |
7 changes: 7 additions & 0 deletions
7
...swc_ecma_compat_bugfixes/tests/__swc_snapshots__/src/async_arrows_in_class.rs/callback.js
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,7 @@ | ||
class Foo { | ||
foo() { | ||
bar(async function() { | ||
return await 1; | ||
}); | ||
} | ||
} |
5 changes: 5 additions & 0 deletions
5
...a_compat_bugfixes/tests/__swc_snapshots__/src/async_arrows_in_class.rs/non_async_arrow.js
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,5 @@ | ||
class Foo { | ||
constructor(){ | ||
this.x = ()=>{}; | ||
} | ||
} |
1 change: 1 addition & 0 deletions
1
...at_bugfixes/tests/__swc_snapshots__/src/async_arrows_in_class.rs/non_class_async_arrow.js
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
let x = async ()=>await 1; |
8 changes: 8 additions & 0 deletions
8
crates/swc_ecma_compat_bugfixes/tests/__swc_snapshots__/src/async_arrows_in_class.rs/this.js
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,8 @@ | ||
class Foo { | ||
constructor(){ | ||
var _this = this; | ||
this.x = ()=>async function() { | ||
return await _this; | ||
}; | ||
} | ||
} |
1 change: 1 addition & 0 deletions
1
..._bugfixes/tests/__swc_snapshots__/src/edge_default_param.rs/destructured_default_value.js
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
const f = ({ a: a = 1 })=>a; |
1 change: 1 addition & 0 deletions
1
...gfixes/tests/__swc_snapshots__/src/edge_default_param.rs/destructured_no_default_value.js
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
const f = ({ a })=>a; |
4 changes: 4 additions & 0 deletions
4
...compat_bugfixes/tests/__swc_snapshots__/src/edge_default_param.rs/nested_default_value.js
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,4 @@ | ||
const f = ({ a: { b: b = 1 } })=>[ | ||
a, | ||
b | ||
]; |
3 changes: 3 additions & 0 deletions
3
...c_ecma_compat_bugfixes/tests/__swc_snapshots__/src/edge_default_param.rs/non_arguments.js
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,3 @@ | ||
const f = ()=>{ | ||
const { a = 1 } = {}; | ||
}; |
4 changes: 4 additions & 0 deletions
4
...s__/src/safari_id_destructuring_collision_in_function_expression.rs/assign_outside_var.js
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,4 @@ | ||
let _a; | ||
(function a([_a1]) { | ||
_a = 3; | ||
}); |
1 change: 1 addition & 0 deletions
1
..._id_destructuring_collision_in_function_expression.rs/assignment_expr_in_default_value.js
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
(function a([_a = _a = 3]) {}); |
3 changes: 3 additions & 0 deletions
3
...ts__/src/safari_id_destructuring_collision_in_function_expression.rs/avoid_collision_1.js
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,3 @@ | ||
(function a([_a1, _a]) { | ||
_a1 + _a; | ||
}); |
3 changes: 3 additions & 0 deletions
3
...ts__/src/safari_id_destructuring_collision_in_function_expression.rs/avoid_collision_2.js
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,3 @@ | ||
(function _a([__a]) { | ||
console.log(__a); | ||
}); |
9 changes: 9 additions & 0 deletions
9
..._swc_snapshots__/src/safari_id_destructuring_collision_in_function_expression.rs/basic.js
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,9 @@ | ||
(function a([_a]) { | ||
_a; | ||
}); | ||
(function a({ ..._a }) { | ||
_a; | ||
}); | ||
(function a({ a: _a }) { | ||
_a; | ||
}); |
Oops, something went wrong.