better self contained module tests - fixes #634

This commit is contained in:
Sebastian McKenzie
2015-01-30 22:32:21 +11:00
parent a9ff73b4f6
commit b1b326cf9c
15 changed files with 46 additions and 13 deletions

View File

@@ -0,0 +1 @@
import foo from "foo";

View File

@@ -0,0 +1,6 @@
define(["exports", "foo", "6to5-runtime/helpers"], function (exports, _foo, _to5RuntimeHelpers) {
"use strict";
var _to5Helpers = _to5RuntimeHelpers;
var foo = _to5Helpers.interopRequire(_foo);
});

View File

@@ -0,0 +1 @@
import foo from "foo";

View File

@@ -0,0 +1,5 @@
"use strict";
var _to5Helpers = require("6to5-runtime/helpers");
var foo = _to5Helpers.interopRequire(require("foo"));

View File

@@ -0,0 +1 @@
foo(...bar);

View File

@@ -0,0 +1,13 @@
System.register(["6to5-runtime/helpers"], function (_export) {
"use strict";
var _to5Helpers;
return {
setters: [function (_to5RuntimeHelpers) {
_to5Helpers = _to5RuntimeHelpers;
}],
execute: function () {
foo.apply(undefined, _to5Helpers.toArray(bar));
}
};
});

View File

@@ -0,0 +1,3 @@
{
"modules": "system"
}

View File

@@ -0,0 +1 @@
import foo from "foo";

View File

@@ -0,0 +1,12 @@
(function (factory) {
if (typeof define === "function" && define.amd) {
define(["exports", "foo", "6to5-runtime/helpers"], factory);
} else if (typeof exports !== "undefined") {
factory(exports, require("foo"), require("6to5-runtime/helpers"));
}
})(function (exports, _foo, _to5RuntimeHelpers) {
"use strict";
var _to5Helpers = _to5RuntimeHelpers;
var foo = _to5Helpers.interopRequire(_foo);
});

View File

@@ -0,0 +1,3 @@
{
"modules": "umd"
}

View File

@@ -1 +0,0 @@
import foo from "someModule";

View File

@@ -1,6 +0,0 @@
define(["exports", "someModule", "6to5-runtime/helpers"], function (exports, _someModule, _to5RuntimeHelpers) {
"use strict";
var _to5Helpers = _to5RuntimeHelpers;
var foo = _to5Helpers.interopRequire(_someModule);
});

View File

@@ -1 +0,0 @@
import * as foo from "someModule";

View File

@@ -1,5 +0,0 @@
"use strict";
var _to5Helpers = require("6to5-runtime/helpers");
var foo = _to5Helpers.interopRequireWildcard(require("someModule"));