mirror of
https://github.com/smogon/pokemon-showdown-client.git
synced 2026-08-28 06:01:11 -05:00
Add mocha tests to npm test
This commit is contained in:
@@ -7,4 +7,5 @@ node_modules/
|
||||
/js/battle-dex.js
|
||||
/js/battle-dex-data.js
|
||||
/js/battle-animations-moves.js
|
||||
/js/battle-scene-stub.js
|
||||
/js/battle-animations.js
|
||||
|
||||
@@ -4,9 +4,6 @@
|
||||
* This script parses index.html and sets the version query string of each
|
||||
* resource to be the MD5 hash of that resource.
|
||||
* It also updates news and the learnsets-g6.js file.
|
||||
*
|
||||
* On the live web server, this script is set as the following git hooks:
|
||||
* post-commit, post-checkout, post-merge, post-rewrite
|
||||
*/
|
||||
|
||||
"use strict";
|
||||
|
||||
@@ -9,7 +9,7 @@
|
||||
"url": "https://github.com/Zarel/Pokemon-Showdown-Client.git"
|
||||
},
|
||||
"scripts": {
|
||||
"test": "eslint --config=.eslintrc.js --cache --cache-file=eslint-cache/base js/ && eslint --config=build-tools/.eslintrc.js --cache --cache-file=eslint-cache/build build-tools/update build-tools/build-indexes",
|
||||
"test": "eslint --config=.eslintrc.js --cache --cache-file=eslint-cache/base js/ && eslint --config=build-tools/.eslintrc.js --cache --cache-file=eslint-cache/build build-tools/update build-tools/build-indexes && node build && mocha",
|
||||
"fix": "eslint --config=.eslintrc.js --fix js/ && eslint --config=build-tools/.eslintrc.js --fix build-tools/update build-tools/build-indexes"
|
||||
},
|
||||
"dependencies": {
|
||||
|
||||
@@ -1,13 +1,16 @@
|
||||
const fs = require('fs');
|
||||
const path = require('path');
|
||||
const assert = require('assert').strict;
|
||||
|
||||
process.chdir(path.resolve(__dirname, '..'));
|
||||
|
||||
window = global;
|
||||
|
||||
// Without making these modules, the best we can do is directly include them into this workspace.
|
||||
eval('' + fs.readFileSync(`${__dirname}/../js/battle-scene-stub.js`));
|
||||
eval('' + fs.readFileSync(`${__dirname}/../js/battle-dex.js`));
|
||||
eval('' + fs.readFileSync(`${__dirname}/../js/battle-dex-data.js`));
|
||||
eval('' + fs.readFileSync(`${__dirname}/../js/battle.js`));
|
||||
eval('' + fs.readFileSync(`js/battle-scene-stub.js`));
|
||||
eval('' + fs.readFileSync(`js/battle-dex.js`));
|
||||
eval('' + fs.readFileSync(`js/battle-dex-data.js`));
|
||||
eval('' + fs.readFileSync(`js/battle.js`));
|
||||
|
||||
describe('Battle', function () {
|
||||
|
||||
|
||||
Reference in New Issue
Block a user