move all plugin tests out of babel-core and into their appropriate folders

This commit is contained in:
Sebastian McKenzie
2015-11-08 23:04:10 -08:00
parent 5f40b53dee
commit 15969a0904
1189 changed files with 365 additions and 65 deletions

View File

@@ -10,5 +10,8 @@
],
"dependencies": {
"babel-runtime": "^5.0.0"
},
"devDependencies": {
"babel-helper-plugin-test-runner": "^6.0.0"
}
}

View File

@@ -0,0 +1 @@
a instanceof b;

View File

@@ -0,0 +1,25 @@
var foo = {};
foo[Symbol.hasInstance]= function () { return true; };
var bar = {};
assert.ok(bar instanceof foo);
assert.ok(new String instanceof String);
//
function Greeting(greeting) {
this.greeting = greeting;
}
Object.defineProperty(Greeting, Symbol.hasInstance, {
value: function(inst) {
return inst.greeting == "hello";
}
});
var a = new Greeting("hello");
var b = new Greeting("world");
assert.ok(a instanceof Greeting);
assert.ok(!(b instanceof Greeting));

View File

@@ -0,0 +1 @@
babelHelpers._instanceof(a, b);

View File

@@ -0,0 +1,3 @@
{
"plugins": ["external-helpers-2", "transform-es2015-instanceof"]
}

View File

@@ -0,0 +1 @@
require("babel-helper-plugin-test-runner")(__dirname);