Skip to content
This repository was archived by the owner on Mar 29, 2021. It is now read-only.

Commit

Permalink
#125: added first dummy test and configs;
Browse files Browse the repository at this point in the history
  • Loading branch information
w20k committed Oct 3, 2016
1 parent 4615c04 commit bb45337
Show file tree
Hide file tree
Showing 5 changed files with 101 additions and 2 deletions.
8 changes: 8 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
# Coverage directory used by tools like istanbul
coverage
# Grunt intermediate storage (http://gruntjs.com/creating-plugins#storing-task-files)
.grunt
# Dependency directories
node_modules
.npm

74 changes: 74 additions & 0 deletions karma.conf.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,74 @@
// Karma configuration

module.exports = function ( config ) {
config.set ( {

// base path that will be used to resolve all patterns (eg. files, exclude)
basePath: './',


// frameworks to use
// available frameworks: https://npmjs.org/browse/keyword/karma-adapter
frameworks: [ 'jasmine' ],


// list of files / patterns to load in the browser
files: [
//Starting point
'src/stable.js',

'src/**/*.js',
'tests/**/*.js'
],


// list of files to exclude
exclude: [
'src/libs/*.js'
],


// preprocess matching files before serving them to the browser
// available preprocessors: https://npmjs.org/browse/keyword/karma-preprocessor
preprocessors: {
'src/**/*.js': ['coverage']
},


// test results reporter to use
// possible values: 'dots', 'progress'
// available reporters: https://npmjs.org/browse/keyword/karma-reporter
reporters: [ 'spec', 'coverage' ],


// 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: false,


// start these browsers
// available browser launchers: https://npmjs.org/browse/keyword/karma-launcher
browsers: [ 'PhantomJS' ],


// Continuous Integration mode
// if true, Karma captures browsers, runs the tests and exits
singleRun: true,

// Concurrency level
// how many browser should be started simultaneous
concurrency: Infinity
} )
};
9 changes: 7 additions & 2 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@
"test": "test"
},
"scripts": {
"test": "echo \"Error: no test specified\" && exit 1"
"test": "./node_modules/karma/bin/karma start karma.conf.js"
},
"repository": {
"type": "git",
Expand All @@ -27,6 +27,11 @@
},
"homepage": "https://github.com/Idrinth/IDotD#idotd",
"devDependencies": {
"jasmine": "^2.4.1"
"jasmine": "^2.5.2",
"karma": "^1.3.0",
"karma-coverage": "^1.1.1",
"karma-jasmine": "^1.0.2",
"karma-phantomjs-launcher": "^1.0.2",
"karma-spec-reporter": "0.0.26"
}
}
Empty file removed tests/landbuy.js
Empty file.
12 changes: 12 additions & 0 deletions tests/mods/land.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
describe ( 'Land.js tests', function () {

it('should have a idrinth variable in scope', function() {
expect(idrinth).toBeDefined();
});


it ( 'should be true', function () {
expect ( 'foo' ).toBe ( 'foo' );
} );

} );

0 comments on commit bb45337

Please sign in to comment.