Add tests to ensure realm-js is usable inside mocha and ava tests

This commit is contained in:
Yavor Georgiev 2016-08-10 15:47:55 +02:00
parent af0ddcdd3d
commit 1a98077794
6 changed files with 45 additions and 0 deletions

View File

@ -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 .

View File

@ -0,0 +1,8 @@
{
"scripts": {
"test": "ava"
},
"devDependencies": {
"ava": "^0.16.0"
}
}

View File

@ -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);
});

View File

@ -0,0 +1,8 @@
{
"scripts": {
"test": "mocha"
},
"devDependencies": {
"mocha": "^3.0.2"
}
}

View File

@ -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');
});
});

1
tests/test-runners/node_modules/realm generated vendored Symbolic link
View File

@ -0,0 +1 @@
../../..