Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

test(ts/compat): Migrate inline tests to fixture testing #6475

Merged
merged 26 commits into from Nov 28, 2022
Merged
Show file tree
Hide file tree
Changes from 25 commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
@@ -0,0 +1,5 @@
function test() {
return function () {
return arguments[0];
};
}
@@ -0,0 +1,5 @@
function test() {
return function() {
return arguments[0];
};
}
@@ -0,0 +1,5 @@
function test() {
return (foo) => {
return foo.arguments;
}
}
@@ -0,0 +1,5 @@
function test() {
return function(foo) {
return foo.arguments;
};
}
@@ -0,0 +1,3 @@
function test() {
return () => arguments[0];
}
@@ -0,0 +1,6 @@
function test() {
var _arguments = arguments;
return function() {
return _arguments[0];
};
}
@@ -0,0 +1 @@
let echo = (bar) => bar
@@ -0,0 +1,3 @@
let echo = function(bar) {
return bar;
};
@@ -0,0 +1,3 @@
function foo() {
const a = (a) => new.target
}
@@ -0,0 +1,6 @@
function foo() {
var _newtarget = new.target;
const a = function(a) {
return _newtarget;
};
}
@@ -0,0 +1,3 @@
var a = {
[(() => this)()]: 123
}
@@ -0,0 +1,6 @@
var _this = this;
var a = {
[function() {
return _this;
}()]: 123
};
@@ -0,0 +1 @@
let foo = ({ bar }) => undefined;
@@ -0,0 +1,3 @@
let foo = function({ bar }) {
return undefined;
};
@@ -0,0 +1 @@
var t = () => 5 + 5;
@@ -0,0 +1,3 @@
var t = function() {
return 5 + 5;
};
@@ -0,0 +1 @@
arr.map(x => x * x);
@@ -0,0 +1,3 @@
arr.map(function(x) {
return x * x;
});
@@ -0,0 +1,9 @@
function fn() {
var foo = () => {
return arguments;
};
}

var bar = () => arguments;

var baz = () => () => arguments;
@@ -0,0 +1,15 @@
var _arguments = arguments;
function fn() {
var _arguments = arguments;
var foo = function() {
return _arguments;
};
}
var bar = function() {
return _arguments;
};
var baz = function() {
return function() {
return _arguments;
};
};
@@ -0,0 +1,16 @@
function b() {
var t = x => this.x + x;
}

class Foo extends (function () { }) {
constructor() {
var foo = () => this;

if (true) {
console.log(super(), foo());
} else {
super();
console.log(foo());
}
}
}
@@ -0,0 +1,20 @@
function b() {
var _this = this;
var t = function(x) {
return _this.x + x;
};
}
class Foo extends function() {} {
constructor(){
var _this;
var foo = function() {
return _this;
};
if (true) {
console.log((super(), _this = this), foo());
} else {
super(), _this = this;
console.log(foo());
}
}
}
@@ -0,0 +1,5 @@
const a = () => ({
get this() { this; arguments },
set arguments(a = this) { this; arguments },
get [this]() { this; arguments },
})
@@ -0,0 +1,17 @@
var _this = this;
const a1 = function() {
return {
get this () {
this;
arguments;
},
set arguments (a = this){
this;
arguments;
},
get [_this] () {
this;
arguments;
}
};
};
@@ -0,0 +1 @@
arr.map(i => i + 1);
@@ -0,0 +1,3 @@
arr.map(function(i) {
return i + 1;
});
@@ -0,0 +1 @@
const foo = () => this
@@ -0,0 +1,4 @@
var _this = this;
const foo = function() {
return _this;
};
@@ -0,0 +1,3 @@
const foo = function () {
() => () => () => this
}
@@ -0,0 +1,10 @@
const foo = function() {
var _this = this;
(function() {
return function() {
return function() {
return _this;
};
};
});
};
@@ -0,0 +1 @@
const foo = () => ({ x, ...y }) => y
@@ -0,0 +1,5 @@
const foo = function() {
return function({ x , ...y }) {
return y;
};
};
@@ -0,0 +1,3 @@
export const getBadgeBorderRadius = (text, color) => {
return (text && style) || {}
}
@@ -0,0 +1,3 @@
export const getBadgeBorderRadius = function(text, color) {
return text && style || {};
};
@@ -0,0 +1,7 @@
const a = () => ({
[this](a = this) { this; arguments },
})
const b = () => class {
static [this]() { }
[arguments]() { }
}
@@ -0,0 +1,15 @@
var _this = this;
const a = function() {
return {
[_this] (a = this) {
this;
arguments;
}
};
};
const b = function() {
return class {
static [this]() {}
[arguments]() {}
};
};
@@ -0,0 +1 @@
var t = (i, x) => i * x;
@@ -0,0 +1,3 @@
var t = function(i, x) {
return i * x;
};
@@ -0,0 +1 @@
var t = i => i * 5;
@@ -0,0 +1,3 @@
var t = function(i) {
return i * 5;
};
@@ -0,0 +1 @@
var t = (i) => i * 5;
@@ -0,0 +1,3 @@
var t = function(i) {
return i * 5;
};
@@ -0,0 +1,5 @@
nums.forEach(v => {
if (v % 5 === 0) {
fives.push(v);
}
});
@@ -0,0 +1,5 @@
nums.forEach(function(v) {
if (v % 5 === 0) {
fives.push(v);
}
});
@@ -0,0 +1,3 @@
export const getBadgeBorderRadius = (text = this, color = arguments) => {
return (text && style) || {}
}
@@ -0,0 +1,4 @@
var _this = this, _arguments = arguments;
export const getBadgeBorderRadius = function(text = _this, color = _arguments) {
return text && style || {};
};
@@ -0,0 +1,4 @@
let foo = () => this;
let bar = () => this;
let foo1 = () => arguments;
let bar1 = () => arguments;
@@ -0,0 +1,13 @@
var _this = this, _arguments = arguments;
let foo = function() {
return _this;
};
let bar = function() {
return _this;
};
let foo1 = function() {
return _arguments;
};
let bar1 = function() {
return _arguments;
};