Skip to content

Commit e1378ea

Browse files
committed
Test task, readme
1 parent 883fbf6 commit e1378ea

File tree

3 files changed

+24
-11
lines changed

3 files changed

+24
-11
lines changed

Gruntfile.js

Lines changed: 16 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -1,17 +1,24 @@
11
module.exports = function(grunt) {
22
grunt.initConfig({
33
connect: {
4+
options: {
5+
//useAvailablePort: true,
6+
port: 8000,
7+
hostname: '*',
8+
base: '.',
9+
//keepalive: true,
10+
livereload: true
11+
//debug: true,
12+
},
413
server: {
514
options: {
6-
//useAvailablePort: true,
7-
port: 8000,
8-
hostname: '*',
9-
base: '.',
10-
//keepalive: true,
11-
livereload: true,
12-
//debug: true,
1315
open: 'http://localhost:8000/examples/testsuite.html'
1416
}
17+
},
18+
test: {
19+
options: {
20+
open: 'http://localhost:8000/test/'
21+
}
1522
}
1623
},
1724
watch: {
@@ -45,7 +52,8 @@ grunt.initConfig({
4552
}
4653
}
4754
});
48-
grunt.registerTask('default', ['connect', 'watch']);
55+
grunt.registerTask('default', ['connect:server', 'watch']);
56+
grunt.registerTask('test', ['connect:test', 'watch']);
4957
grunt.registerTask('fetchSamples', 'fetch sample images from 500px api', function(){
5058
var done = this.async(),
5159
API500px = require('500px').API500px,

README.md

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -52,5 +52,10 @@ See [caniuse.com/canvas](http://caniuse.com/canvas)
5252

5353
The API is not yet finalized. Look at the code and expect changes.
5454

55+
## Tests
56+
57+
You can run the tests using grunt test. Alternatively you can also just run grunt (the default task) and open http://localhost:8000/test/.
58+
The test coverage for smartcrop.js is very limited at the moment. I expect to improve this as the code matures and the concepts solidify.
59+
5560
## License
5661
Copyright (c) 2014 Jonas Wanger, licensed under the MIT License (enclosed)

test/index.html

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
<html>
22
<head>
33
<meta charset="utf-8">
4-
<title>Mocha Tests</title>
4+
<title>smartcrop.js Mocha Tests</title>
55
<link rel="stylesheet" href="../node_modules/mocha/mocha.css" />
66
</head>
77
<body>
@@ -15,8 +15,8 @@
1515
</script>
1616
<script src="smartcrop.js"></script>
1717
<script>
18-
mocha.checkLeaks();
19-
mocha.globals(['jQuery', 'LiveReload', '__screenCapturePageContext__']);
18+
//mocha.checkLeaks();
19+
//mocha.globals(['jQuery', 'LiveReload', '__screenCapturePageContext__']);
2020
mocha.run();
2121
</script>
2222
</body>

0 commit comments

Comments
 (0)