Skip to content

Commit 763c359

Browse files
author
Cache Hamm
committed
Add example runner script
1 parent e339cf5 commit 763c359

File tree

2 files changed

+16
-1
lines changed

2 files changed

+16
-1
lines changed

package.json

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,8 @@
1111
"lint:fix": "standard --fix --env mocha",
1212
"prepublishOnly": "npm run build",
1313
"build": "babel --stage 1 -d dist/ src/",
14-
"watch": "babel --watch --stage 1 -d dist/ src"
14+
"watch": "babel --watch --stage 1 -d dist/ src",
15+
"examples": "./test/support/example_runner.sh"
1516
},
1617
"repository": {
1718
"type": "git",

test/support/example_runner.sh

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,14 @@
1+
#!/bin/bash
2+
3+
#
4+
# npm links the examples directory to the local copy of json-rules-engine
5+
# and runs all examples. This can be used to test a release candidate version
6+
# against the examples as an extra compatiblity test
7+
#
8+
THIS_DIR="$( cd "$( dirname "${BASH_SOURCE[0]}" )" >/dev/null 2>&1 && pwd )"
9+
10+
cd $THIS_DIR/../.. # project root
11+
npm link
12+
cd $THIS_DIR/../../examples # examples directory
13+
npm link json-rules-engine
14+
for i in *.js; do node $i; done;

0 commit comments

Comments
 (0)