mirror of
https://github.com/moparisthebest/mail
synced 2025-02-16 23:20:09 -05:00
Fix phantom mocha tests
This commit is contained in:
parent
84d5bd8124
commit
c6fb31fd49
14
Gruntfile.js
14
Gruntfile.js
@ -32,19 +32,13 @@ module.exports = function(grunt) {
|
|||||||
}
|
}
|
||||||
},
|
},
|
||||||
|
|
||||||
mocha: {
|
mocha_phantomjs: {
|
||||||
all: {
|
all: {
|
||||||
options: {
|
options: {
|
||||||
urls: [
|
urls: [
|
||||||
'http://localhost:<%= connect.test.options.port %>/test/unit/index.html',
|
'http://localhost:<%= connect.test.options.port %>/test/unit/index.html',
|
||||||
'http://localhost:<%= connect.test.options.port %>/test/integration/index.html'
|
'http://localhost:<%= connect.test.options.port %>/test/integration/index.html'
|
||||||
],
|
]
|
||||||
run: false,
|
|
||||||
reporter: 'Spec',
|
|
||||||
log: false,
|
|
||||||
|
|
||||||
// phanotmjs is soooo slow
|
|
||||||
timeout: 100000
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
@ -367,7 +361,6 @@ module.exports = function(grunt) {
|
|||||||
grunt.loadNpmTasks('grunt-contrib-uglify');
|
grunt.loadNpmTasks('grunt-contrib-uglify');
|
||||||
grunt.loadNpmTasks('grunt-contrib-connect');
|
grunt.loadNpmTasks('grunt-contrib-connect');
|
||||||
grunt.loadNpmTasks('grunt-contrib-jshint');
|
grunt.loadNpmTasks('grunt-contrib-jshint');
|
||||||
grunt.loadNpmTasks('grunt-mocha');
|
|
||||||
grunt.loadNpmTasks('grunt-contrib-clean');
|
grunt.loadNpmTasks('grunt-contrib-clean');
|
||||||
grunt.loadNpmTasks('grunt-csso');
|
grunt.loadNpmTasks('grunt-csso');
|
||||||
grunt.loadNpmTasks('grunt-contrib-sass');
|
grunt.loadNpmTasks('grunt-contrib-sass');
|
||||||
@ -376,6 +369,7 @@ module.exports = function(grunt) {
|
|||||||
grunt.loadNpmTasks('grunt-contrib-copy');
|
grunt.loadNpmTasks('grunt-contrib-copy');
|
||||||
grunt.loadNpmTasks('grunt-contrib-compress');
|
grunt.loadNpmTasks('grunt-contrib-compress');
|
||||||
grunt.loadNpmTasks('grunt-manifest');
|
grunt.loadNpmTasks('grunt-manifest');
|
||||||
|
grunt.loadNpmTasks('grunt-mocha-phantomjs');
|
||||||
|
|
||||||
// Build tasks
|
// Build tasks
|
||||||
grunt.registerTask('dist-css', ['sass', 'autoprefixer', 'csso']);
|
grunt.registerTask('dist-css', ['sass', 'autoprefixer', 'csso']);
|
||||||
@ -385,7 +379,7 @@ module.exports = function(grunt) {
|
|||||||
|
|
||||||
// Test/Dev tasks
|
// Test/Dev tasks
|
||||||
grunt.registerTask('dev', ['connect:dev']);
|
grunt.registerTask('dev', ['connect:dev']);
|
||||||
grunt.registerTask('test', ['jshint', 'connect:test', 'mocha']);
|
grunt.registerTask('test', ['jshint', 'connect:test', 'mocha_phantomjs']);
|
||||||
grunt.registerTask('prod', ['connect:prod']);
|
grunt.registerTask('prod', ['connect:prod']);
|
||||||
|
|
||||||
//
|
//
|
||||||
|
@ -63,8 +63,8 @@
|
|||||||
"grunt-contrib-watch": "~0.5.3",
|
"grunt-contrib-watch": "~0.5.3",
|
||||||
"grunt-csso": "~0.6.1",
|
"grunt-csso": "~0.6.1",
|
||||||
"grunt-manifest": "^0.4.0",
|
"grunt-manifest": "^0.4.0",
|
||||||
"grunt-mocha": "~0.4.1",
|
"grunt-mocha-phantomjs": "^0.6.0",
|
||||||
"mocha": "~1.13.0",
|
"mocha": "^1.21.4",
|
||||||
"sinon": "~1.7.3",
|
"sinon": "~1.7.3",
|
||||||
"time-grunt": "^1.0.0"
|
"time-grunt": "^1.0.0"
|
||||||
}
|
}
|
||||||
|
@ -23,7 +23,11 @@
|
|||||||
<script src="index.js"></script>
|
<script src="index.js"></script>
|
||||||
|
|
||||||
<script>
|
<script>
|
||||||
|
if (window.mochaPhantomJS) {
|
||||||
|
mochaPhantomJS.run();
|
||||||
|
} else {
|
||||||
mocha.run();
|
mocha.run();
|
||||||
|
}
|
||||||
</script>
|
</script>
|
||||||
</body>
|
</body>
|
||||||
</html>
|
</html>
|
@ -25,7 +25,12 @@
|
|||||||
<script>
|
<script>
|
||||||
mocha.checkLeaks();
|
mocha.checkLeaks();
|
||||||
mocha.globals(['chrome']);
|
mocha.globals(['chrome']);
|
||||||
|
|
||||||
|
if (window.mochaPhantomJS) {
|
||||||
|
mochaPhantomJS.run();
|
||||||
|
} else {
|
||||||
mocha.run();
|
mocha.run();
|
||||||
|
}
|
||||||
</script>
|
</script>
|
||||||
</body>
|
</body>
|
||||||
</html>
|
</html>
|
||||||
|
Loading…
Reference in New Issue
Block a user