move all plugin tests out of babel-core and into their appropriate folders
This commit is contained in:
@@ -0,0 +1 @@
|
||||
a instanceof b;
|
||||
25
packages/babel-plugin-transform-es2015-instanceof/test/fixtures/instanceof/instanceof/exec.js
vendored
Normal file
25
packages/babel-plugin-transform-es2015-instanceof/test/fixtures/instanceof/instanceof/exec.js
vendored
Normal 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));
|
||||
@@ -0,0 +1 @@
|
||||
babelHelpers._instanceof(a, b);
|
||||
@@ -0,0 +1,3 @@
|
||||
{
|
||||
"plugins": ["external-helpers-2", "transform-es2015-instanceof"]
|
||||
}
|
||||
@@ -0,0 +1 @@
|
||||
require("babel-helper-plugin-test-runner")(__dirname);
|
||||
Reference in New Issue
Block a user