diff --git a/scripts/test.sh b/scripts/test.sh index a6c7cc36..4c0c9c5e 100755 --- a/scripts/test.sh +++ b/scripts/test.sh @@ -157,6 +157,18 @@ case "$TARGET" in node "$SRCROOT/tests" ;; +"test-runners") + npm install + scripts/download-core.sh node + src/node/build-node.sh $CONFIGURATION + + for runner in ava mocha; do + pushd "$SRCROOT/tests/test-runners/$runner" + npm install + npm test + popd + done + ;; "object-store") pushd src/object-store cmake -DCMAKE_BUILD_TYPE=$CONFIGURATION . diff --git a/tests/test-runners/ava/package.json b/tests/test-runners/ava/package.json new file mode 100644 index 00000000..c4099996 --- /dev/null +++ b/tests/test-runners/ava/package.json @@ -0,0 +1,8 @@ +{ + "scripts": { + "test": "ava" + }, + "devDependencies": { + "ava": "^0.16.0" + } +} diff --git a/tests/test-runners/ava/test.js b/tests/test-runners/ava/test.js new file mode 100644 index 00000000..1829e6d3 --- /dev/null +++ b/tests/test-runners/ava/test.js @@ -0,0 +1,7 @@ +import test from 'ava'; + +test('can require Realm', t => { + var realm = require('realm'); + t.is('function', typeof realm); + t.is('Realm', realm.name); +}); \ No newline at end of file diff --git a/tests/test-runners/mocha/package.json b/tests/test-runners/mocha/package.json new file mode 100644 index 00000000..9c84aa0f --- /dev/null +++ b/tests/test-runners/mocha/package.json @@ -0,0 +1,8 @@ +{ + "scripts": { + "test": "mocha" + }, + "devDependencies": { + "mocha": "^3.0.2" + } +} diff --git a/tests/test-runners/mocha/test.js b/tests/test-runners/mocha/test.js new file mode 100644 index 00000000..7432c8db --- /dev/null +++ b/tests/test-runners/mocha/test.js @@ -0,0 +1,9 @@ +var assert = require('assert'); + +describe('Realm', function() { + it('should be requirable', function() { + var realm = require('realm'); + assert.equal(typeof realm, 'function'); + assert.equal(realm.name, 'Realm'); + }); +}); diff --git a/tests/test-runners/node_modules/realm b/tests/test-runners/node_modules/realm new file mode 120000 index 00000000..a8a4f8c2 --- /dev/null +++ b/tests/test-runners/node_modules/realm @@ -0,0 +1 @@ +../../.. \ No newline at end of file