-
-
Notifications
You must be signed in to change notification settings - Fork 32.4k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Browse files
Browse the repository at this point in the history
- Add grunt, mocha. - Modularize functions in build. - Tests for functions and types. - Grunt watch for rerunning tests on file save. - Wrap argv in main() + only run when executing as a script. - main() now accepts parameterized object literal for simulating args. - #1139 split file renaming into module / argument. - Tests + Fixture for result output.
- Loading branch information
Showing
50 changed files
with
527 additions
and
94 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,39 @@ | ||
module.exports = function(grunt) { | ||
|
||
grunt.loadNpmTasks('grunt-mocha-test'); | ||
grunt.loadNpmTasks('grunt-contrib-watch'); | ||
|
||
grunt.initConfig({ | ||
mochaTest: { | ||
test: { | ||
options: { | ||
reporter: 'spec', | ||
clearRequireCache: true | ||
}, | ||
src: ['test/*.js'] | ||
}, | ||
}, | ||
|
||
watch: { | ||
js: { | ||
options: { | ||
spawn: false, | ||
}, | ||
files: ['build.js', 'test/*.js'], | ||
tasks: ['default'] | ||
} | ||
} | ||
}); | ||
|
||
// On watch events, if the changed file is a test file then configure mochaTest to only | ||
// run the tests from that file. Otherwise run all the tests | ||
var defaultTestSrc = grunt.config('mochaTest.test.src'); | ||
grunt.event.on('watch', function(action, filepath) { | ||
grunt.config('mochaTest.test.src', defaultTestSrc); | ||
if (filepath.match('test/')) { | ||
grunt.config('mochaTest.test.src', filepath); | ||
} | ||
}); | ||
|
||
grunt.registerTask('default', 'mochaTest'); | ||
}; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,12 @@ | ||
function defaultFilter(fileName, fileSuffix) { | ||
if (fileSuffix) { | ||
fileName.replace(fileSuffix, ".svg"); | ||
} else { | ||
fileName = fileName.replace('.svg', '.jsx'); | ||
} | ||
fileName = fileName.replace(/_/g, '-'); | ||
return fileName; | ||
} | ||
|
||
|
||
module.exports = defaultFilter; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,14 @@ | ||
function myFilter(fileName, fileSuffix) { | ||
if (fileSuffix && fileName.indexOf(fileSuffix, fileName.length - fileSuffix.length) !== -1) { | ||
fileName = fileName.replace(fileSuffix, '.jsx'); | ||
fileName = fileName.slice(3); | ||
fileName = fileName.replace(/_/g, '-'); | ||
|
||
if (fileName.indexOf('3d') === 0) { | ||
fileName = 'three-d' + fileName.slice(2); | ||
} | ||
return fileName; | ||
} | ||
} | ||
|
||
module.exports = myFilter; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,12 @@ | ||
Game Icons Test Fixtures | ||
======================== | ||
|
||
Source: http://game-icons.net/ | ||
Date: July 7, 2015 | ||
License: [CC BY 3.0](http://creativecommons.org/licenses/by/3.0/) | ||
Extracted from SVG (B/T) set. | ||
|
||
|
||
Layout: | ||
|
||
``svg/`` - follows structure of unzipped game-icons assets. |
1 change: 1 addition & 0 deletions
1
...-icons/svg/icons/delapouite/dice/svg/000000/transparent/dice-six-faces-five.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
1 change: 1 addition & 0 deletions
1
...-icons/svg/icons/delapouite/dice/svg/000000/transparent/dice-six-faces-four.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
1 change: 1 addition & 0 deletions
1
...ns/delapouite/dice/svg/000000/transparent/perspective-dice-six-faces-random.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
1 change: 1 addition & 0 deletions
1
...icons/delapouite/dice/svg/000000/transparent/perspective-dice-six-faces-six.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
1 change: 1 addition & 0 deletions
1
...me-icons/svg/icons/john-colburn/originals/svg/000000/transparent/pistol-gun.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Oops, something went wrong.