Skip to content

Commit 2aadaa5

Browse files
bz2steren
authored andcommitted
Switch npm test to using mocha directly (#54)
Remove gulp-mocha-phantomjs dependency and run tests without a browser context. Loading test.html in a browser still succeeds. Remove gulp test task. Update to latest chai version now phantomjs is not involved. Introduce setup file for tests that requires the needed components and populates the global object. This can be folded back into the test file later and a browser importable version generated as a step in the build process. For now it needs some lint overrides. Only handle requests in the mock XMLHttpRequest implementation which match the endpoint url.
1 parent abeda70 commit 2aadaa5

5 files changed

Lines changed: 83 additions & 628 deletions

File tree

gulpfile.js

Lines changed: 1 addition & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,6 @@ var rename = require('gulp-rename');
1919
var replace = require('gulp-replace');
2020
var uglify = require('gulp-uglify');
2121
var sourcemaps = require('gulp-sourcemaps');
22-
var mochaPhantomJS = require('gulp-mocha-phantomjs');
2322
var concat = require('gulp-concat');
2423

2524
var SRC_FILE = 'stackdriver-errors.js';
@@ -29,12 +28,6 @@ var dependencies = [
2928
'./node_modules/stacktrace-js/dist/stacktrace-with-promises-and-json-polyfills.js',
3029
];
3130

32-
gulp.task('test', function () {
33-
return gulp
34-
.src('test/test.html')
35-
.pipe(mochaPhantomJS({reporter: 'spec'}));
36-
});
37-
3831
gulp.task('dist', function() {
3932
return gulp.src(dependencies.concat(SRC_FILE))
4033
.pipe(sourcemaps.init({ loadMaps: true }))
@@ -65,5 +58,5 @@ gulp.task('demo-js', function() {
6558
.pipe(gulp.dest('dist'));
6659
});
6760

68-
gulp.task('default', ['test']);
61+
gulp.task('default', ['dist']);
6962
gulp.task('demo', ['dist', 'demo-html', 'demo-js']);

0 commit comments

Comments
 (0)