mirror of
https://github.com/status-im/realm-js.git
synced 2025-01-22 20:41:18 +00:00
Add tests to ensure realm-js is usable inside mocha and ava tests
This commit is contained in:
parent
af0ddcdd3d
commit
1a98077794
@ -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 .
|
||||
|
8
tests/test-runners/ava/package.json
Normal file
8
tests/test-runners/ava/package.json
Normal file
@ -0,0 +1,8 @@
|
||||
{
|
||||
"scripts": {
|
||||
"test": "ava"
|
||||
},
|
||||
"devDependencies": {
|
||||
"ava": "^0.16.0"
|
||||
}
|
||||
}
|
7
tests/test-runners/ava/test.js
Normal file
7
tests/test-runners/ava/test.js
Normal 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);
|
||||
});
|
8
tests/test-runners/mocha/package.json
Normal file
8
tests/test-runners/mocha/package.json
Normal file
@ -0,0 +1,8 @@
|
||||
{
|
||||
"scripts": {
|
||||
"test": "mocha"
|
||||
},
|
||||
"devDependencies": {
|
||||
"mocha": "^3.0.2"
|
||||
}
|
||||
}
|
9
tests/test-runners/mocha/test.js
Normal file
9
tests/test-runners/mocha/test.js
Normal 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
1
tests/test-runners/node_modules/realm
generated
vendored
Symbolic link
@ -0,0 +1 @@
|
||||
../../..
|
Loading…
x
Reference in New Issue
Block a user