-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
6 changed files
with
97 additions
and
21 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 |
---|---|---|
@@ -1,23 +1,31 @@ | ||
language: node_js | ||
language: | ||
- node_js | ||
env: | ||
global: | ||
- NODE_VERSION=6 | ||
- secure: H+Qtnvo8ZsQ5AwytSqVmZbxGYG0ncLFT35i3XKvySwTqlnsaLoZ7HxSti9PireNzJ3y3NT8ePlv1OlLfSFJ7jU7GLkHq+v9O/1duBc5RFtYliwIjlVjotkhS8vX6HlMakL4xeaeU72E6DPPZN36MdMwrDEgZUN3TGEFNiFK50/t8CYPb1avvSwfxbTK/xgtm0u3IfSydOhpq0DrrwhbZSk/krgvfejil3CZ377Z892Hagcsks7GHvz7yVhW5z6kFyW7Th4y6mW/v21OgGKdxtCJCpHXT3JetOlpbEtqtxIZGogNOyXtzCHFvrbZmw3TPH4/0/HMkIy4o2o9rcay23W6YvoBELQDZMVTgf/6yyxt19eMFUXuofNO3vSYu9ALRwoX9jIE7JqoA9g4BZ4vGXf1ucG/Ak6gP/C7+kXYTgTL254RuTQeRq7fwg4ootKINm7DjPwAXUs+Kpb0XtnPej58Mzqu3Rnlm+6RfPvfzE+23xMCMY2xOCLXv2JZOOp9qZqjtcbnnnkHlft/OnUFR4UG1tMjuh7TD/Ci714HuYyGYlpTWHzCVSteMhCFbL4fmWhth0A1evfD9Rtuq2ErGyxIMPiEPe+xDIC5ljR82I8GIp0FpKUEoX3OaMFvaeM8wG68RWVzjIetyJFHn3p77EalX2U4UWKljriXDHrM5KIA= | ||
node_js: | ||
- 5.0.0 | ||
before_install: | ||
- npm install -g gulp | ||
- 6.0.0 | ||
branches: | ||
only: | ||
- master | ||
cache: | ||
directories: | ||
- node_modules | ||
- app/node_modules | ||
- "$HOME/.electron" | ||
- "$HOME/.npm" | ||
before_install: | ||
- git clone https://github.com/creationix/nvm.git ~/.nvm | ||
- source ~/.nvm/nvm.sh | ||
- nvm install $NODE_VERSION | ||
- nvm use --delete-prefix $NODE_VERSION | ||
install: | ||
- npm prune | ||
- npm install | ||
script: | ||
- npm test | ||
- npm run webpack | ||
notifications: | ||
email: | ||
- [email protected] | ||
before_deploy: gulp deploy | ||
deploy: | ||
provider: releases | ||
api_key: | ||
secure: H+Qtnvo8ZsQ5AwytSqVmZbxGYG0ncLFT35i3XKvySwTqlnsaLoZ7HxSti9PireNzJ3y3NT8ePlv1OlLfSFJ7jU7GLkHq+v9O/1duBc5RFtYliwIjlVjotkhS8vX6HlMakL4xeaeU72E6DPPZN36MdMwrDEgZUN3TGEFNiFK50/t8CYPb1avvSwfxbTK/xgtm0u3IfSydOhpq0DrrwhbZSk/krgvfejil3CZ377Z892Hagcsks7GHvz7yVhW5z6kFyW7Th4y6mW/v21OgGKdxtCJCpHXT3JetOlpbEtqtxIZGogNOyXtzCHFvrbZmw3TPH4/0/HMkIy4o2o9rcay23W6YvoBELQDZMVTgf/6yyxt19eMFUXuofNO3vSYu9ALRwoX9jIE7JqoA9g4BZ4vGXf1ucG/Ak6gP/C7+kXYTgTL254RuTQeRq7fwg4ootKINm7DjPwAXUs+Kpb0XtnPej58Mzqu3Rnlm+6RfPvfzE+23xMCMY2xOCLXv2JZOOp9qZqjtcbnnnkHlft/OnUFR4UG1tMjuh7TD/Ci714HuYyGYlpTWHzCVSteMhCFbL4fmWhth0A1evfD9Rtuq2ErGyxIMPiEPe+xDIC5ljR82I8GIp0FpKUEoX3OaMFvaeM8wG68RWVzjIetyJFHn3p77EalX2U4UWKljriXDHrM5KIA= | ||
file: | ||
- "dist/js/sdm.min.js" | ||
- "dist/js/sdm.min.js.map" | ||
skip_cleanup: true | ||
on: | ||
tags: true | ||
all_branches: true | ||
- [email protected] |
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
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
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 |
---|---|---|
|
@@ -7,10 +7,18 @@ | |
"example": "example" | ||
}, | ||
"scripts": { | ||
"test": "echo 0", | ||
"test": "ava", | ||
"webpack": "webpack --display-error-details;", | ||
"watch": "webpack --watch --display-error-details;" | ||
}, | ||
"ava": { | ||
"files": [ | ||
"test/*.js" | ||
], | ||
"failFast": true, | ||
"tap": true, | ||
"babel": "inherit" | ||
}, | ||
"repository": { | ||
"type": "git", | ||
"url": "git+https://[email protected]/kimorkim/sudokuMaker.git" | ||
|
@@ -25,13 +33,15 @@ | |
}, | ||
"homepage": "https://github.com/kimorkim/sudokuMaker#readme", | ||
"devDependencies": { | ||
"ava": "^0.16.0", | ||
"babel": "^6.5.2", | ||
"babel-core": "^6.14.0", | ||
"babel-loader": "^6.2.5", | ||
"babel-plugin-add-module-exports": "^0.2.1", | ||
"babel-plugin-transform-es2015-modules-umd": "^6.12.0", | ||
"babel-preset-es2015": "^6.14.0", | ||
"babel-preset-stage-2": "^6.13.0", | ||
"babel-register": "^6.14.0", | ||
"babel-runtime": "^6.11.6", | ||
"core-js": "^2.4.1", | ||
"webpack": "^1.13.2" | ||
|
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,54 @@ | ||
import test from 'ava'; | ||
import sudokuMaker from '../dist/sudokuMaker'; | ||
|
||
const testData = {"inCorrectData":[[[4,8,4],[6,5,1],[2,7,9]],[[2,7,9],[3,8,4],[6,5,1]],[[6,5,1],[2,7,9],[3,8,4]],[[4,3,8],[1,6,5],[9,2,7]],[[9,2,7],[4,3,8],[1,6,5]],[[1,6,5],[9,2,7],[4,3,8]],[[8,4,3],[5,1,6],[7,9,2]],[[7,9,2],[8,4,3],[5,1,6]],[[5,1,6],[7,9,2],[8,4,3]]]}; | ||
const failCaseData = {"state":"FAIL","box":{"002":{"_i":0,"_j":0,"_k":2},"000":{"_i":0,"_j":0,"_k":0}},"rows":{"002":{"_i":0,"_j":0,"_k":2},"000":{"_i":0,"_j":0,"_k":0}},"cols":{"300":{"_i":3,"_j":0,"_k":0},"000":{"_i":0,"_j":0,"_k":0}}}; | ||
|
||
test.before(t => { | ||
if(!('createGame' in sudokuMaker)) { | ||
t.fail('sudokuMaker not have createGame'); | ||
} | ||
Object.assign(testData, sudokuMaker.createGame()); | ||
}) | ||
|
||
|
||
test('Get GameData', t => { | ||
const gameData = sudokuMaker.createGame(); | ||
|
||
if(gameData && 'correctData' in gameData && 'data' in gameData) { | ||
t.pass('sudokuMaker Complete Game Create'); | ||
} else { | ||
t.fail('Do not Create Game'); | ||
} | ||
}); | ||
|
||
test('GameCheck Test', t => { | ||
t.plan(3); | ||
|
||
if(!('gameDataCheck' in sudokuMaker)) { | ||
t.fail('sudokuMaker not have GameData Check'); | ||
} | ||
|
||
const failCase = sudokuMaker.gameDataCheck(testData.inCorrectData); | ||
const solvingCase = sudokuMaker.gameDataCheck(testData.data); | ||
const successCase = sudokuMaker.gameDataCheck(testData.correctData); | ||
|
||
if(successCase && successCase.state === 'SUCCESS') { | ||
t.pass('SUCCESS CHECK COMPLETE'); | ||
} else { | ||
t.fail('SUCCESS CHECK FAIL'); | ||
} | ||
|
||
if(solvingCase && solvingCase.state === 'SOLVING') { | ||
t.pass('SOLVING CHECK COMPLETE'); | ||
} else { | ||
t.fail('SOLVING CHECK FAIL'); | ||
} | ||
|
||
if(failCase && failCase.state === 'FAIL') { | ||
t.deepEqual(failCase, failCaseData, 'FAILCASE CHECK COMPLETE') | ||
} else { | ||
t.fail('FAILCASE CHECK FAIL'); | ||
} | ||
|
||
}); |