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

@@ -0,0 +1,3 @@
var f = ctx::ns.obj.func;
var g = ::ns.obj.func;
var h = new X::y;

View File

@@ -0,0 +1,5 @@
var _context;
var f = (_context = ctx, ns.obj.func).bind(_context);
var g = (_context = ns.obj).func.bind(_context);
var h = (_context = new X(), y).bind(_context);

View File

@@ -0,0 +1,4 @@
ctx::ns.obj.func();
::ns.obj.func();
ns.obj2::ns.obj1.func();

View File

@@ -0,0 +1,6 @@
var _context;
(_context = ctx, ns.obj.func).call(_context);
(_context = ns.obj).func.call(_context);
(_context = ns.obj2, ns.obj1.func).call(_context);

View File

@@ -0,0 +1,6 @@
import { map, takeWhile, forEach } from "iterlib";
getPlayers()
::map(x => x.character())
::takeWhile(x => x.strength > 100)
::forEach(x => console.log(x));

View File

@@ -0,0 +1,29 @@
var operations = [];
var lib = {};
['f', 'g', 'h'].forEach(function (key) {
var func = function () {
return operations.push("lib." + key + "()");
};
Object.defineProperty(lib, key, {
get: function () {
operations.push("get lib." + key);
return func;
}
});
});
({prop:'value'})
::lib.f()
::lib.g()
::lib.h();
assert.deepEqual(operations, [
'get lib.f',
'lib.f()',
'get lib.g',
'lib.g()',
'get lib.h',
'lib.h()'
]);

View File

@@ -0,0 +1,11 @@
var _context;
import { map, takeWhile, forEach } from "iterlib";
(_context = (_context = (_context = getPlayers(), map).call(_context, function (x) {
return x.character();
}), takeWhile).call(_context, function (x) {
return x.strength > 100;
}), forEach).call(_context, function (x) {
return console.log(x);
});

View File

@@ -0,0 +1,3 @@
{
"plugins": ["transform-function-bind", "transform-es2015-arrow-functions"]
}

View File

@@ -0,0 +1,5 @@
var bar = function () {};
foo::bar;
var foo = {};
::foo.bar;

View File

@@ -0,0 +1,5 @@
var bar = function () {};
bar.bind(foo);
var foo = {};
foo.bar.bind(foo);

View File

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