Skip to content

Commit ded585b

Browse files
committed
Change test setup
1 parent a9ef7ea commit ded585b

12 files changed

+92
-253
lines changed

Gruntfile.coffee

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

README.md

Lines changed: 10 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
# srcissors
22

33
Image cropping for responsive images.
4-
(~4kB minified and gzipped)
4+
(~5kB minified and gzipped)
55

66
### Js
77

@@ -109,13 +109,19 @@ All the UI elements are styled with CSS. Just start with the CSS from `examples/
109109

110110
```bash
111111
# Watch for changes and fire up a webserver with livereload
112-
grunt dev
112+
npm run start
113113

114114
# Run the tests with karma
115-
grunt test
115+
npm run test
116+
117+
# Run the tests in the major browsers (Chrome,Firefox,Safari,Electron)
118+
npm run test:browsers
116119

117120
# Run tests and build scrissors.js and scrissors.min.js
118-
grunt build
121+
npm run build
122+
123+
# Publish the module to npm
124+
npm run build && npm version minor && git push && npm publish
119125
```
120126

121127

bower.json

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

karma.conf.coffee

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

karma.conf.js

Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,20 @@
1+
module.exports = function (config) {
2+
config.set({
3+
frameworks: ['mocha', 'sinon-chai', 'browserify'],
4+
files: ['./test/specs/*.coffee', {pattern: './test/**/*', included: false}],
5+
preprocessors: {
6+
'./test/specs/*': ['browserify']
7+
},
8+
browserify: {
9+
transform: ['coffeeify'],
10+
extensions: ['.js', '.coffee']
11+
},
12+
port: 8080,
13+
reporters: ['dots'],
14+
logLevel: config.LOG_INFO,
15+
browsers: ['Electron'],
16+
captureTimeout: 20000,
17+
autoWatch: true,
18+
singleRun: true
19+
})
20+
}

package.json

Lines changed: 37 additions & 29 deletions
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,15 @@
55
"description": "Image cropping for responsive images",
66
"author": "upfront.io",
77
"license": "LGPL-3.0+",
8+
"scripts": {
9+
"test": "karma start",
10+
"test:watch": "karma start --no-single-run",
11+
"test:browsers": "karma start --browsers Chrome,Firefox,Safari,Electron",
12+
"start": "cd ./examples && budo ../src/srcissors.coffee:srcissors.js --live --dir . -p 8080 -o -- -t coffeeify --extension='.coffee'",
13+
"build": "npm test -s && npm run normal -s && npm run minified -s",
14+
"normal": "browserify ./src/srcissors.coffee -t coffeeify --extension='.coffee' -t browserify-shim > srcissors.js",
15+
"minified": "uglifyjs srcissors.js > srcissors.min.js"
16+
},
817
"keywords": [
918
"crop",
1019
"image"
@@ -15,38 +24,37 @@
1524
},
1625
"browser": "src/srcissors.coffee",
1726
"main": "src/srcissors.coffee",
27+
"peerDependencies": {
28+
"jquery": ">=2.1.3"
29+
},
1830
"devDependencies": {
19-
"browserify": "^6.2.0",
20-
"chai": "^1.9.2",
21-
"coffeeify": "^0.7.0",
22-
"grunt": "^0.4.5",
23-
"grunt-browserify": "^3.1.0",
24-
"grunt-bump": "0.0.16",
25-
"grunt-contrib-clean": "^0.6.0",
26-
"grunt-contrib-coffee": "^0.12.0",
27-
"grunt-contrib-concat": "^0.5.0",
28-
"grunt-contrib-connect": "^0.9.0",
29-
"grunt-contrib-copy": "^0.7.0",
30-
"grunt-contrib-uglify": "^0.7.0",
31-
"grunt-contrib-watch": "^0.6.1",
32-
"grunt-karma": "^0.9.0",
33-
"grunt-mocha-test": "^0.12.2",
34-
"grunt-shell": "^1.1.1",
35-
"jquery": "^2.1.3",
36-
"karma": "^0.12.24",
37-
"karma-chrome-launcher": "^0.1.5",
38-
"karma-coffee-preprocessor": "^0.2.1",
39-
"karma-firefox-launcher": "^0.1.3",
40-
"karma-mocha": "^0.1.9",
41-
"karma-phantomjs-launcher": "^0.1.4",
42-
"karma-safari-launcher": "^0.1.1",
43-
"karma-script-launcher": "^0.1.0",
44-
"karma-sinon-chai": "^0.2.0",
45-
"load-grunt-tasks": "^1.0.0",
46-
"mocha": "^2.0.1",
47-
"sinon": "^1.11.1"
31+
"browserify": "^14.1.0",
32+
"browserify-shim": "^3.8.13",
33+
"chai": "^3.5.0",
34+
"coffeeify": "^2.1.0",
35+
"electron": "^1.4.15",
36+
"jquery": "^3.1.1",
37+
"karma": "^1.4.1",
38+
"karma-browserify": "^5.1.1",
39+
"karma-chrome-launcher": "^2.0.0",
40+
"karma-electron": "^5.1.1",
41+
"karma-firefox-launcher": "^1.0.0",
42+
"karma-mocha": "^1.3.0",
43+
"karma-safari-launcher": "^1.0.0",
44+
"karma-sinon-chai": "^1.2.4",
45+
"mocha": "^3.2.0",
46+
"uglify-js": "^2.7.5",
47+
"watchify": "^3.9.0"
4848
},
4949
"engines": {
5050
"node": ">=0.10.0"
51+
},
52+
"browserify-shim": {
53+
"jquery": "global:jQuery"
54+
},
55+
"dependencies": {
56+
"karma-chai": "^0.1.0",
57+
"sinon": "^1.17.7",
58+
"sinon-chai": "^2.8.0"
5159
}
5260
}

src/crop.coffee

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,4 @@
1+
$ = require('jquery')
12
Preview = require('./preview')
23
Events = require('./events')
34

src/events.coffee

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,5 @@
1+
$ = require('jquery')
2+
13
module.exports = class Events
24

35
constructor: ({ @parent, @view, horizontal, vertical, actions }) ->

src/srcissors.coffee

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,4 @@
1+
$ = require('jquery')
12
Crop = require('./crop')
23

34
module.exports = window.srcissors =

0 commit comments

Comments
 (0)