Merge pull request #102 from juliandescottes/add-integration-tests

Add integration tests
This commit is contained in:
Julian Descottes 2013-05-26 23:56:31 -07:00
commit a3f8e29c7b
7 changed files with 92 additions and 19 deletions

6
.jshintrc Normal file
View File

@ -0,0 +1,6 @@
{
"evil": true,
"asi": true,
"smarttabs": true,
"eqnull": true
}

View File

@ -1,3 +1,13 @@
language: node_js
node_js:
- 0.6
language: node_js
node_js:
- 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
View 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']);
};

View File

@ -1,2 +0,0 @@
test:
jshint js/*.js

BIN
mongoose-3.7.exe Normal file

Binary file not shown.

View File

@ -1,15 +1,20 @@
{
"author": "People",
"name": "piskel",
"description": "Web based 2d animations editor",
"version": "0.0.1",
"homepage": "http://github.com/juliandescottes/piskel",
"repository": {
"type": "git",
"url": "http://github.com/juliandescottes/piskel.git"
},
"scripts": { "test": "make test" },
"devDependencies": {
"jshint": "0.6.1"
}
{
"author": "People",
"name": "piskel",
"description": "Web based 2d animations editor",
"version": "0.0.1",
"homepage": "http://github.com/juliandescottes/piskel",
"repository": {
"type": "git",
"url": "http://github.com/juliandescottes/piskel.git"
},
"scripts": {
"test": "grunt test"
},
"devDependencies": {
"grunt": "0.4.1",
"grunt-contrib-connect": "0.3.0",
"grunt-contrib-jshint": "0.5.4",
"grunt-ghost": "1.0.12"
}
}

View 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();
});