mirror of
https://github.com/status-im/realm-js.git
synced 2025-01-27 06:44:56 +00:00
Made a node package that uses the shared tests to run in node
This commit is contained in:
parent
cb4ef75f70
commit
a7e2483428
@ -345,22 +345,27 @@ case "$TARGET" in
|
||||
if [ "$(uname)" = 'Darwin' ]; then
|
||||
download_server
|
||||
start_server
|
||||
npm_tests_cmd="npm run test"
|
||||
npm install --build-from-source --realm_enable_sync
|
||||
else
|
||||
npm_tests_cmd="npm run test"
|
||||
npm install --build-from-source
|
||||
fi
|
||||
|
||||
# Change to a temp directory.
|
||||
cd "$(mktemp -q -d -t realm.node.XXXXXX)"
|
||||
test_temp_dir=$PWD # set it to be cleaned at exit
|
||||
|
||||
pushd "$SRCROOT/tests"
|
||||
npm install
|
||||
eval "$npm_tests_cmd"
|
||||
pushd "$SRCROOT/tests/node"
|
||||
|
||||
if [ "$(uname)" = 'Darwin' ]; then
|
||||
npm install --build-from-source --realm_enable_sync
|
||||
else
|
||||
npm install --build-from-source
|
||||
fi
|
||||
|
||||
npm test
|
||||
|
||||
popd
|
||||
stop_server
|
||||
|
||||
if [ "$(uname)" = 'Darwin' ]; then
|
||||
stop_server
|
||||
fi
|
||||
;;
|
||||
"electron")
|
||||
if [ "$(uname)" = 'Darwin' ]; then
|
||||
@ -392,7 +397,7 @@ case "$TARGET" in
|
||||
# npm test -- --filter=GarbageCollectionTests
|
||||
# npm test -- --filter=AsyncTests
|
||||
|
||||
npm test -- --process=main
|
||||
# npm test -- --process=main
|
||||
npm test -- --process=render
|
||||
|
||||
popd
|
||||
|
14
tests/node/package.json
Normal file
14
tests/node/package.json
Normal file
@ -0,0 +1,14 @@
|
||||
{
|
||||
"name": "realm-node-tests",
|
||||
"private": true,
|
||||
"description": "Test harness running the Realm JS tests in a node process.",
|
||||
"main": "index.js",
|
||||
"scripts": {
|
||||
"test": "node ./unit-tests.js",
|
||||
"test-sync-integration": "node ./sync-integration-tests.js"
|
||||
},
|
||||
"devDependencies": {
|
||||
"realm": "../..",
|
||||
"realm-tests": "../shared"
|
||||
}
|
||||
}
|
11
tests/node/unit-tests.js
Normal file
11
tests/node/unit-tests.js
Normal file
@ -0,0 +1,11 @@
|
||||
"use strict";
|
||||
|
||||
const path = require("path");
|
||||
|
||||
const SPEC_PATH = require.resolve("realm-tests/spec/unit_tests.js");
|
||||
const JASMINE_SPEC_PATH = path.resolve(__dirname, "node_modules", "realm-tests", "spec");
|
||||
const JASMINE_CONFIG_PATH = require.resolve("realm-tests/spec/support/jasmine.json");
|
||||
|
||||
const jasmine = require("realm-tests/jasmine.js");
|
||||
jasmine.loadConfigFile(JASMINE_CONFIG_PATH);
|
||||
jasmine.execute([ SPEC_PATH ], jasmine.getFilterFromProcess());
|
Loading…
x
Reference in New Issue
Block a user