From b3d7bda215d1b3de14f9ae7d370b58d1c9797a1b Mon Sep 17 00:00:00 2001 From: Skyler Kehren Date: Sat, 2 May 2020 12:51:58 +0300 Subject: [PATCH] Fixing PR review comments Adds direct example for installing screeps-server-mockup Adds test-integration script that prints where to find more info Fixes typo in integration: testing docs --- docs/in-depth/testing.md | 9 ++++++++- package.json | 1 + 2 files changed, 9 insertions(+), 1 deletion(-) diff --git a/docs/in-depth/testing.md b/docs/in-depth/testing.md index 2d2f033..a115e82 100644 --- a/docs/in-depth/testing.md +++ b/docs/in-depth/testing.md @@ -47,6 +47,13 @@ magnitude, it is recommended to prefer unit tests wherever possible. Before starting to use integration testing, you must install [screeps-server-mockup](https://github.com/screepers/screeps-server-mockup) to your project. Please view that repository for more instruction on installation. +```bash +# Using yarn: +yarn add -D screeps-server-mockup +# Using npm +npm install --save-dev screeps-server-mockup +``` + You will also need to add scripts to run integration tests. In `package.json`, add a new `test-integration` script and add the new integration testing to the main `test` script. @@ -67,7 +74,7 @@ environment. Integration tests are completely representative of the real game (in fact they run with an actual Screeps server). This comes at the cost of performance and very involved setup when creating specific scenarios. -Server testing support is implmented via +Server testing support is implemented via [screeps-server-mockup](https://github.com/screepers/screeps-server-mockup). View this repository for more information on the API. diff --git a/package.json b/package.json index 40bc813..9348485 100644 --- a/package.json +++ b/package.json @@ -12,6 +12,7 @@ "push-sim": "rollup -c --environment DEST:sim", "test": "npm run test-unit", "test-unit": "rollup -c rollup.test-unit-config.js && mocha dist/test-unit.bundle.js", + "test-integration": "echo 'See docs/in-depth/testing.md for instructions on enabling integration tests'", "watch-main": "rollup -cw --environment DEST:main", "watch-pserver": "rollup -cw --environment DEST:pserver", "watch-sim": "rollup -cw --environment DEST:sim"