Skip to content

Commit 7a8d5f7

Browse files
committed
update tests
1 parent 1f19d30 commit 7a8d5f7

File tree

8 files changed

+3007
-809
lines changed

8 files changed

+3007
-809
lines changed

.babelrc

+4-1
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,6 @@
11
{
2-
"presets": [ "stage-3" ]
2+
"presets": [
3+
"es2015",
4+
"es2017"
5+
]
36
}

gulpfile.js

+4-3
Original file line numberDiff line numberDiff line change
@@ -109,7 +109,6 @@ gulp.task('min', ['editPro'], function () {
109109
})
110110

111111
gulp.task('test', function () {
112-
console.log(pathTest + testScript);
113112
return rollup({
114113
input: pathTest + testScript,
115114
context: 'window',
@@ -120,7 +119,9 @@ gulp.task('test', function () {
120119
main: true,
121120
browser: true,
122121
}),
123-
babel(),
122+
// babel({
123+
// exclude: 'node_modules/**' // only transpile our source code
124+
// }),
124125
],
125126
}).then(function (bundle) {
126127
return bundle.write({
@@ -187,7 +188,7 @@ gulp.task('server', function() {
187188
gulp.watch(pathSrc + script, ['makeDevCopy']);
188189
gulp.watch(scriptSources, ['min']);
189190
gulp.watch(pathSrc + helperIEScript, ['helper-ie8']);
190-
gulp.watch([pathTest + testScript], ['test']);
191+
// gulp.watch([pathTest + testScript], ['test']);
191192
gulp.watch(['**/*.html', pathTest + '*.js', pathDest + '*.css', pathDest + 'min/*.js']).on('change', browserSync.reload);
192193
});
193194

package.json

+11-2
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,8 @@
77
"test": "tests"
88
},
99
"scripts": {
10-
"test": ""
10+
"start": "nodemon --watch tests/js/tests.js --exec npm test",
11+
"test": "babel tests/js/tests.js -o tests/js/tests.min.js"
1112
},
1213
"repository": {
1314
"type": "git",
@@ -19,5 +20,13 @@
1920
"bugs": {
2021
"url": "https://github.com/ganlanyuan/tiny-slider/issues"
2122
},
22-
"homepage": "https://github.com/ganlanyuan/tiny-slider#readme"
23+
"homepage": "https://github.com/ganlanyuan/tiny-slider#readme",
24+
"dependencies": {
25+
"babel-cli": "^6.26.0",
26+
"babel-core": "^6.26.3",
27+
"babel-polyfill": "^6.26.0",
28+
"babel-preset-es2015": "^6.24.1",
29+
"babel-preset-es2017": "^6.24.1",
30+
"nodemon": "^1.17.5"
31+
}
2332
}

0 commit comments

Comments
 (0)