Skip to content

Commit 64fb3c6

Browse files
committed
add mochify
1 parent eb05463 commit 64fb3c6

File tree

6 files changed

+49
-26
lines changed

6 files changed

+49
-26
lines changed

.min-wd

Lines changed: 24 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,24 @@
1+
{
2+
"sauceLabs": true,
3+
"sauceJobName": "stringjs test",
4+
"BUILD_VAR": "TRAVIS_BUILD_NUMBER",
5+
"browsers": [
6+
{
7+
"name": "chrome"
8+
},
9+
{
10+
"name": "firefox"
11+
},
12+
{
13+
"name": "safari"
14+
},
15+
{
16+
"name": "internet explorer",
17+
"version": "10"
18+
},
19+
{
20+
"name": "internet explorer",
21+
"version": "11"
22+
}
23+
]
24+
}

.travis.yml

Lines changed: 10 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,4 +2,13 @@ language: node_js
22
node_js:
33
- 0.10
44
- 0.12
5-
- iojs
5+
- iojs
6+
7+
cache:
8+
directories:
9+
- node_modules
10+
11+
env:
12+
global:
13+
- SAUCE_USERNAME=stringjs
14+
- SAUCE_ACCESS_KEY=04afebd2-6375-4c09-ada4-c218609ab3da

README.md

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,9 @@
33

44
[![build status](https://secure.travis-ci.org/jprichardson/string.js.png)](http://travis-ci.org/jprichardson/string.js)
55

6+
7+
[![Sauce Test Status](https://saucelabs.com/browser-matrix/stringjs.svg)](https://saucelabs.com/u/stringjs)
8+
69
`string.js`, or simply `S` is a lightweight (**< 5 kb** minified and gzipped) JavaScript library for the browser or for Node.js that provides extra String methods. Originally, it modified the String prototype. But I quickly learned that in JavaScript, this is considered poor practice.
710

811

gulpfile.js

Lines changed: 10 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,7 @@ var gulp = require('gulp'),
55
browserify = require('gulp-browserify'),
66
SRC = './lib/string.js',
77
TEST_SRC = './test/string.test.js',
8+
mochify = require('mochify'),
89
DEST = 'dist',
910
mocha = require('gulp-mocha'),
1011
SRC_COMPILED = 'string.js',
@@ -19,11 +20,19 @@ gulp.task('browserify', function() {
1920
.pipe(gulp.dest(DEST));
2021
});
2122

22-
gulp.task('test', ['browserify'], function () {
23+
gulp.task('browser-test', function (done) {
24+
return mochify( { wd: true } )
25+
.on('error', function(err){ if(err) done(err); else done(); })
26+
.bundle();
27+
});
28+
29+
gulp.task('unit-test', ['browserify'], function () {
2330
return gulp.src(TEST_SRC, {read: false})
2431
.pipe(mocha({reporter: 'spec', growl: 1}));
2532
});
2633

34+
gulp.task('test', ['unit-test', 'browser-test']);
35+
2736
gulp.task('clean', function() {
2837
return gulp.src(DEST)
2938
.pipe(rimraf());

package.json

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -39,11 +39,12 @@
3939
"gulp-uglify": "1.1.0",
4040
"istanbul": "*",
4141
"mocha": "*",
42+
"mochify": "^2.9.0",
4243
"uglify-js": "1.3.x"
4344
},
4445
"main": "lib/string",
4546
"scripts": {
46-
"test": "mocha test",
47+
"test": "gulp test",
4748
"istanbul": "node_modules/.bin/istanbul cover node_modules/.bin/_mocha test/string.test.js"
4849
}
4950
}

test/browser.test.html

Lines changed: 0 additions & 23 deletions
This file was deleted.

0 commit comments

Comments
 (0)