move all plugin tests out of babel-core and into their appropriate folders
This commit is contained in:
@@ -11,5 +11,8 @@
|
||||
"dependencies": {
|
||||
"babel-plugin-syntax-class-properties": "^6.0.14",
|
||||
"babel-runtime": "^5.0.0"
|
||||
},
|
||||
"devDependencies": {
|
||||
"babel-helper-plugin-test-runner": "^6.0.0"
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -0,0 +1,9 @@
|
||||
var foo = "bar";
|
||||
|
||||
class Foo {
|
||||
bar = foo;
|
||||
|
||||
constructor() {
|
||||
var foo = "foo";
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,13 @@
|
||||
var foo = "bar";
|
||||
|
||||
var Foo = function Foo() {
|
||||
babelHelpers.classCallCheck(this, Foo);
|
||||
|
||||
_initialiseProps.call(this);
|
||||
|
||||
var foo = "foo";
|
||||
};
|
||||
|
||||
var _initialiseProps = function () {
|
||||
this.bar = foo;
|
||||
};
|
||||
@@ -0,0 +1,3 @@
|
||||
class Foo extends Bar {
|
||||
bar = "foo";
|
||||
}
|
||||
@@ -0,0 +1,12 @@
|
||||
var Foo = (function (_Bar) {
|
||||
babelHelpers.inherits(Foo, _Bar);
|
||||
|
||||
function Foo(...args) {
|
||||
var _temp, _this;
|
||||
|
||||
babelHelpers.classCallCheck(this, Foo);
|
||||
return babelHelpers.possibleConstructorReturn(_this, (_temp = (_this = babelHelpers.possibleConstructorReturn(this, Object.getPrototypeOf(Foo).call(this, ...args)), _this), _this.bar = "foo", _temp));
|
||||
}
|
||||
|
||||
return Foo;
|
||||
})(Bar);
|
||||
@@ -0,0 +1,3 @@
|
||||
class Foo {
|
||||
bar;
|
||||
}
|
||||
@@ -0,0 +1,3 @@
|
||||
var Foo = function Foo() {
|
||||
babelHelpers.classCallCheck(this, Foo);
|
||||
};
|
||||
@@ -0,0 +1,3 @@
|
||||
class Foo {
|
||||
bar = "foo";
|
||||
}
|
||||
@@ -0,0 +1,4 @@
|
||||
var Foo = function Foo() {
|
||||
babelHelpers.classCallCheck(this, Foo);
|
||||
this.bar = "foo";
|
||||
};
|
||||
3
packages/babel-plugin-transform-class-properties/test/fixtures/class-properties/options.json
vendored
Normal file
3
packages/babel-plugin-transform-class-properties/test/fixtures/class-properties/options.json
vendored
Normal file
@@ -0,0 +1,3 @@
|
||||
{
|
||||
"plugins": ["external-helpers-2", "transform-class-properties", "transform-es2015-classes", "transform-es2015-block-scoping", "syntax-class-properties"]
|
||||
}
|
||||
@@ -0,0 +1,3 @@
|
||||
class Foo {
|
||||
static bar;
|
||||
}
|
||||
@@ -0,0 +1,6 @@
|
||||
class Foo {
|
||||
static num;
|
||||
}
|
||||
|
||||
assert.equal("num" in Foo, false);
|
||||
assert.equal(Foo.num, undefined);
|
||||
@@ -0,0 +1,3 @@
|
||||
var Foo = function Foo() {
|
||||
babelHelpers.classCallCheck(this, Foo);
|
||||
};
|
||||
@@ -0,0 +1,3 @@
|
||||
class Foo {
|
||||
static bar = "foo";
|
||||
}
|
||||
@@ -0,0 +1,9 @@
|
||||
class Foo {
|
||||
static num = 0;
|
||||
static str = "foo";
|
||||
}
|
||||
|
||||
assert.equal(Foo.num, 0);
|
||||
assert.equal(Foo.num = 1, 1);
|
||||
assert.equal(Foo.str, "foo");
|
||||
assert.equal(Foo.str = "bar", "bar");
|
||||
@@ -0,0 +1,5 @@
|
||||
var Foo = function Foo() {
|
||||
babelHelpers.classCallCheck(this, Foo);
|
||||
};
|
||||
|
||||
Foo.bar = "foo";
|
||||
@@ -0,0 +1,7 @@
|
||||
class Foo extends Bar {
|
||||
bar = "foo";
|
||||
|
||||
constructor() {
|
||||
foo(super());
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,14 @@
|
||||
var Foo = (function (_Bar) {
|
||||
babelHelpers.inherits(Foo, _Bar);
|
||||
|
||||
function Foo() {
|
||||
var _temp, _this;
|
||||
|
||||
babelHelpers.classCallCheck(this, Foo);
|
||||
|
||||
foo((_temp = (_this = babelHelpers.possibleConstructorReturn(this, Object.getPrototypeOf(Foo).call(this)), _this), _this.bar = "foo", _temp));
|
||||
return _this;
|
||||
}
|
||||
|
||||
return Foo;
|
||||
})(Bar);
|
||||
@@ -0,0 +1,7 @@
|
||||
class Foo extends Bar {
|
||||
bar = "foo";
|
||||
|
||||
constructor() {
|
||||
super();
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,14 @@
|
||||
var Foo = (function (_Bar) {
|
||||
babelHelpers.inherits(Foo, _Bar);
|
||||
|
||||
function Foo() {
|
||||
babelHelpers.classCallCheck(this, Foo);
|
||||
|
||||
var _this = babelHelpers.possibleConstructorReturn(this, Object.getPrototypeOf(Foo).call(this));
|
||||
|
||||
_this.bar = "foo";
|
||||
return _this;
|
||||
}
|
||||
|
||||
return Foo;
|
||||
})(Bar);
|
||||
@@ -0,0 +1 @@
|
||||
require("babel-helper-plugin-test-runner")(__dirname);
|
||||
Reference in New Issue
Block a user