Skip to content
This repository was archived by the owner on Oct 9, 2020. It is now read-only.

Commit cfbbbbb

Browse files
committed
Merge pull request #41 from douglasduteil/test-add-supa-light-simple-auto-test
test: add supa light simple auto test
2 parents c8a5f08 + 51469bf commit cfbbbbb

3 files changed

Lines changed: 52 additions & 5 deletions

File tree

package.json

Lines changed: 17 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,13 @@
33
"version": "0.0.11",
44
"registry": "npm",
55
"jspmPackage": true,
6+
"scripts": {
7+
"build": "./build.sh",
8+
"clear": "rm -rf build-babel/node_modules build-babel/jspm_packages regenerator-runtime.js systemjs-babel-node.js systemjs-babel-browser.js",
9+
"prepublish": "npm run build",
10+
"preversion": "npm run test",
11+
"test": "node test/index.js"
12+
},
613
"main": "plugin-babel.js",
714
"map": {
815
"systemjs-babel-build": {
@@ -18,10 +25,15 @@
1825
},
1926
"files": [
2027
"plugin-babel.js",
21-
"babel-helpers",
22-
"babel-helpers.js",
23-
"regenerator-runtime.js",
24-
"systemjs-babel-browser.js",
28+
"babel-helpers",
29+
"babel-helpers.js",
30+
"regenerator-runtime.js",
31+
"systemjs-babel-browser.js",
2532
"systemjs-babel-node.js"
26-
]
33+
],
34+
"devDependencies": {
35+
"browser-run": "^3.2.0",
36+
"systemjs": "^0.19.29",
37+
"tape": "^4.5.1"
38+
}
2739
}

test/index.js

Lines changed: 28 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,28 @@
1+
'use strict';
2+
3+
var test = require('tape');
4+
var SystemJS = require('systemjs');
5+
6+
test('systemjs-plugin-babel', function (t) {
7+
t.plan(1);
8+
9+
// given
10+
System.config({
11+
map: {
12+
'plugin-babel': './plugin-babel.js',
13+
'systemjs-babel-build': './systemjs-babel-browser.js'
14+
},
15+
transpiler: 'plugin-babel'
16+
});
17+
18+
// when
19+
System.import('test/testing-code.js')
20+
21+
// then
22+
.then(function(m) {
23+
return m.p().then(function (message) {
24+
t.equal(message, 'Rocks :)');
25+
});
26+
})
27+
.then(t.end, t.end);
28+
});

test/testing-code.js

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
export async function p() {
2+
return await new Promise(function(resolve, reject) {
3+
setTimeout(function() {
4+
resolve('Rocks :)');
5+
}, 0);
6+
});
7+
}

0 commit comments

Comments
 (0)