Setup automatic qunit testing.

This commit is contained in:
Nicolas Stepien 2012-10-13 17:41:52 +02:00
parent 3650eb2af7
commit 4630f3c876
6 changed files with 41 additions and 3 deletions

3
.travis.yml Normal file
View File

@ -0,0 +1,3 @@
language: node_js
node_js:
- 0.8

View File

@ -20,7 +20,7 @@
// @icon https://github.com/MayhemYDG/4chan-x/raw/stable/img/icon.gif
// ==/UserScript==
/* 4chan X Alpha - Version 3.0.0 - 2012-09-26
/* 4chan X Alpha - Version 3.0.0 - 2012-10-13
* http://mayhemydg.github.com/4chan-x/
*
* Copyright (c) 2009-2011 James Campos <james.r.campos@gmail.com>

View File

@ -1,4 +1,6 @@
# Get 4chan X [HERE](http://mayhemydg.github.com/4chan-x/).
# 4chan X [![Build Status](https://secure.travis-ci.org/MayhemYDG/4chan-x.png?branch=master)](https://travis-ci.org/MayhemYDG/4chan-x)
Get it [here](http://mayhemydg.github.com/4chan-x/).
***

View File

@ -76,6 +76,13 @@ module.exports = function(grunt) {
},
clean: {
tmp:['tmp']
},
qunit: {
all: 'http://localhost:8000/test/index.html'
},
server: {
port: 8000,
base: '.'
}
});
@ -88,5 +95,6 @@ module.exports = function(grunt) {
grunt.registerTask('release', 'concat:meta concat:latest default exec:commit exec:push');
grunt.registerTask('patch', 'bump');
grunt.registerTask('upgrade', 'bump:minor');
grunt.registerTask('test', 'server qunit');
};

View File

@ -3,6 +3,9 @@
"version": "3.0.0",
"author": "Nicolas Stepien <stepien.nicolas@gmail.com>",
"description": "Cross-browser userscript for maximum lurking on 4chan.",
"scripts": {
"test": "grunt test --verbose"
},
"repository": {
"type": "git",
"url": "https://github.com/MayhemYDG/4chan-x.git"
@ -12,7 +15,11 @@
"grunt-contrib-clean": "0.3.x",
"grunt-contrib-coffee": "0.3.x",
"grunt-exec": "0.3.x",
"grunt-image-embed": "0.0.x"
"grunt-image-embed": "0.0.x",
"qunitjs": "1.x.x"
},
"devDependencies": {
"grunt": "0.3.x"
},
"license": "MIT",
"engines": {

18
test/index.html Normal file
View File

@ -0,0 +1,18 @@
<!DOCTYPE html>
<html>
<head>
<meta charset='utf-8'>
<title>QUnit</title>
<link rel='stylesheet' href='../node_modules/qunitjs/qunit/qunit.css'>
</head>
<body>
<div id='qunit'></div>
<script src='../node_modules/qunitjs/qunit/qunit.js'></script>
<script>
module('test module');
test('test', function() {
ok(true, 'Passed!');
});
</script>
</body>
</html>