Test setup

This commit is contained in:
Ben Ramey
2014-03-08 19:47:33 -06:00
parent de43992273
commit 81346d05e7
4 changed files with 126 additions and 104 deletions

View File

@@ -1,68 +0,0 @@
// Karma configuration
// Generated on Sat Mar 08 2014 19:22:15 GMT-0600 (CST)
module.exports = function(config) {
config.set({
// base path, that will be used to resolve files and exclude
basePath: '',
// frameworks to use
frameworks: ['jasmine'],
// list of files / patterns to load in the browser
files: [
'tests/**/*.js'
],
// list of files to exclude
exclude: [
],
// test results reporter to use
// possible values: 'dots', 'progress', 'junit', 'growl', 'coverage'
reporters: ['progress'],
// web server port
port: 9876,
// enable / disable colors in the output (reporters and logs)
colors: true,
// level of logging
// possible values: config.LOG_DISABLE || config.LOG_ERROR || config.LOG_WARN || config.LOG_INFO || config.LOG_DEBUG
logLevel: config.LOG_INFO,
// enable / disable watching file and executing tests whenever any file changes
autoWatch: true,
// Start these browsers, currently available:
// - Chrome
// - ChromeCanary
// - Firefox
// - Opera (has to be installed with `npm install karma-opera-launcher`)
// - Safari (only Mac; has to be installed with `npm install karma-safari-launcher`)
// - PhantomJS
// - IE (only Windows; has to be installed with `npm install karma-ie-launcher`)
browsers: ['Chrome'],
// If browser does not capture in given timeout [ms], kill it
captureTimeout: 60000,
// Continuous Integration mode
// if true, it capture browsers, run tests and exit
singleRun: false
});
};

View File

@@ -1,38 +1,49 @@
{ {
"name": "lunch", "name": "lunch",
"private": true, "private": true,
"version": "0.0.0", "version": "0.0.0",
"description": "a Sails application", "description": "a Sails application",
"dependencies": { "dependencies": {
"sails": "0.9.9", "sails": "0.9.9",
"grunt": "0.4.1", "grunt": "0.4.1",
"sails-disk": "~0.9.0", "sails-disk": "~0.9.0",
"optimist": "0.3.4", "optimist": "0.3.4",
"then-jade": "1.1.0", "then-jade": "1.1.0",
"sails-mongo": "latest", "sails-mongo": "latest",
"mongodb": "latest" "mongodb": "latest"
}, },
"scripts": { "scripts": {
"start": "node app.js", "start": "node app.js",
"debug": "node debug app.js" "debug": "node debug app.js"
}, },
"main": "app.js", "main": "app.js",
"repository": "", "repository": "",
"author": "", "author": "",
"license": "", "license": "",
"devDependencies": { "devDependencies": {
"load-grunt-tasks": "~0.3.0", "load-grunt-tasks": "~0.3.0",
"glob": "3.2.8", "glob": "3.2.8",
"grunt-contrib-clean": "~0.5.0", "grunt-contrib-clean": "~0.5.0",
"grunt-contrib-copy": "~0.5.0", "grunt-contrib-copy": "~0.5.0",
"grunt-contrib-concat": "~0.3.0", "grunt-contrib-concat": "~0.3.0",
"grunt-contrib-jst": "~0.5.1", "grunt-contrib-jst": "~0.5.1",
"grunt-contrib-watch": "~0.5.3", "grunt-contrib-watch": "~0.5.3",
"grunt-contrib-uglify": "~0.3.2", "grunt-contrib-uglify": "~0.3.2",
"grunt-contrib-cssmin": "~0.8.0", "grunt-contrib-cssmin": "~0.8.0",
"grunt-contrib-less": "~0.9.0", "grunt-contrib-less": "~0.9.0",
"grunt-contrib-coffee": "~0.10.1", "grunt-contrib-coffee": "~0.10.1",
"grunt-sails-linker": "~0.9.5", "grunt-sails-linker": "~0.9.5",
"grunt-contrib-jade": "~0.10.0" "grunt-contrib-jade": "~0.10.0",
} "karma-script-launcher": "~0.1.0",
"karma-chrome-launcher": "~0.1.2",
"karma-firefox-launcher": "~0.1.3",
"karma-html2js-preprocessor": "~0.1.0",
"karma-jasmine": "~0.1.5",
"karma-coffee-preprocessor": "~0.1.3",
"requirejs": "~2.1.11",
"karma-requirejs": "~0.2.1",
"karma-phantomjs-launcher": "~0.1.2",
"karma": "~0.10.9",
"grunt-karma": "~0.6.2"
}
} }

73
tasks/options/karma.js Normal file
View File

@@ -0,0 +1,73 @@
// Karma configuration
// Generated on Sat Mar 08 2014 19:22:15 GMT-0600 (CST)
module.exports = function(config) {
return {
unit: {
options: {
// base path, that will be used to resolve files and exclude
basePath: '',
// frameworks to use
frameworks: ['jasmine'],
// list of files / patterns to load in the browser
files: [
'assets/linker/js/vendor/angular.js',
'assets/linker/js/controllers/*.js',
'tests/**/*.js'
],
// list of files to exclude
exclude: [
],
// test results reporter to use
// possible values: 'dots', 'progress', 'junit', 'growl', 'coverage'
reporters: ['progress'],
// web server port
port: 9876,
// enable / disable colors in the output (reporters and logs)
colors: true,
// level of logging
// possible values: config.LOG_DISABLE || config.LOG_ERROR || config.LOG_WARN || config.LOG_INFO || config.LOG_DEBUG
logLevel: config.LOG_INFO,
// enable / disable watching file and executing tests whenever any file changes
autoWatch: true,
// Start these browsers, currently available:
// - Chrome
// - ChromeCanary
// - Firefox
// - Opera (has to be installed with `npm install karma-opera-launcher`)
// - Safari (only Mac; has to be installed with `npm install karma-safari-launcher`)
// - PhantomJS
// - IE (only Windows; has to be installed with `npm install karma-ie-launcher`)
browsers: ['Chrome'],
// If browser does not capture in given timeout [ms], kill it
captureTimeout: 60000,
// Continuous Integration mode
// if true, it capture browsers, run tests and exit
singleRun: false
}
}
};
};

6
tests/unit/fake.js Normal file
View File

@@ -0,0 +1,6 @@
describe("test test", function() {
it('should be false', function() {
var bob = 1;
expect(bob).toBe(1);
});
});