Merge pull request #102 from juliandescottes/add-integration-tests
Add integration tests
This commit is contained in:
commit
a3f8e29c7b
7 changed files with 92 additions and 19 deletions
6
.jshintrc
Normal file
6
.jshintrc
Normal file
|
@ -0,0 +1,6 @@
|
|||
{
|
||||
"evil": true,
|
||||
"asi": true,
|
||||
"smarttabs": true,
|
||||
"eqnull": true
|
||||
}
|
12
.travis.yml
12
.travis.yml
|
@ -1,3 +1,13 @@
|
|||
language: node_js
|
||||
node_js:
|
||||
- 0.6
|
||||
- 0.8
|
||||
before_install:
|
||||
- npm install -g grunt-cli
|
||||
- git clone git://github.com/n1k0/casperjs.git ~/casperjs
|
||||
- cd ~/casperjs
|
||||
- git checkout tags/1.0.2
|
||||
- export PATH=$PATH:`pwd`/bin
|
||||
- cd -
|
||||
before_script:
|
||||
- phantomjs --version
|
||||
- casperjs --version
|
||||
|
|
46
Gruntfile.js
Normal file
46
Gruntfile.js
Normal file
|
@ -0,0 +1,46 @@
|
|||
module.exports = function(grunt) {
|
||||
grunt.initConfig({
|
||||
jshint: {
|
||||
options: {
|
||||
jshintrc: '.jshintrc'
|
||||
},
|
||||
files: [
|
||||
'Gruntfile.js',
|
||||
'package.json',
|
||||
// TODO(grosbouddha): change to js/**/*.js and fix the 10K jshint
|
||||
// error messages or fine-tune .jshintrc file.
|
||||
'js/*.js'
|
||||
]
|
||||
},
|
||||
connect: {
|
||||
www: {
|
||||
options: {
|
||||
base: '.',
|
||||
port: 4545
|
||||
}
|
||||
}
|
||||
},
|
||||
ghost: {
|
||||
dist: {
|
||||
filesSrc: ['tests/integration/casperjs/*_test.js'],
|
||||
options: {
|
||||
args: {
|
||||
baseUrl: 'http://localhost:' +
|
||||
'<%= connect.www.options.port %>/'
|
||||
},
|
||||
direct: false,
|
||||
logLevel: 'error',
|
||||
printCommand: false,
|
||||
printFilePaths: true
|
||||
}
|
||||
}
|
||||
}
|
||||
});
|
||||
|
||||
grunt.loadNpmTasks('grunt-contrib-connect');
|
||||
grunt.loadNpmTasks('grunt-contrib-jshint');
|
||||
grunt.loadNpmTasks('grunt-ghost');
|
||||
|
||||
grunt.registerTask('test', ['jshint', 'connect', 'ghost']);
|
||||
|
||||
};
|
2
Makefile
2
Makefile
|
@ -1,2 +0,0 @@
|
|||
test:
|
||||
jshint js/*.js
|
BIN
mongoose-3.7.exe
Normal file
BIN
mongoose-3.7.exe
Normal file
Binary file not shown.
|
@ -8,8 +8,13 @@
|
|||
"type": "git",
|
||||
"url": "http://github.com/juliandescottes/piskel.git"
|
||||
},
|
||||
"scripts": { "test": "make test" },
|
||||
"scripts": {
|
||||
"test": "grunt test"
|
||||
},
|
||||
"devDependencies": {
|
||||
"jshint": "0.6.1"
|
||||
"grunt": "0.4.1",
|
||||
"grunt-contrib-connect": "0.3.0",
|
||||
"grunt-contrib-jshint": "0.5.4",
|
||||
"grunt-ghost": "1.0.12"
|
||||
}
|
||||
}
|
8
tests/integration/casperjs/smoke_test.js
Normal file
8
tests/integration/casperjs/smoke_test.js
Normal file
|
@ -0,0 +1,8 @@
|
|||
casper
|
||||
.start(casper.cli.get('baseUrl'))
|
||||
.then(function () {
|
||||
this.test.assertExists('#drawing-canvas-container canvas', 'Check if drawing canvas element is created');
|
||||
})
|
||||
.run(function () {
|
||||
this.test.done();
|
||||
});
|
Loading…
Reference in a new issue