realm-js/tests/electron/app/jasmine.js
Kræn Hansen e4e1431c55 Running js tests in Electron renderer process (#1196)
* First take on running the tests inside an Electron render process

* Making progress

* Making it possible to override the location of the admin token

* Ignoreing the realm-object-server files

* Fixing a console.log to return a string instead of a boolean

But it should probably be removed entirely

* Making the downloaded ROS log less

* Adjusting comments in the test.sh

* Checking number of windows to determine an Electron crash

* Added a test that triggers garbage collection of ArrayBuffers

* Enabled the ability to run the tests in Electrons main process

* Run tests first in main process and the render

* Added a README.md that documents how Electron tests can be run

* Added a comment on why the garbage-collection test was added.

* Waiting with reading the admin token, until it is actually used

* Disabling the GarbageCollectionTests for now
2017-08-11 10:30:57 +02:00

27 lines
717 B
JavaScript

"use strict";
const Jasmine = require("jasmine");
const JasmineConsoleReporter = require('jasmine-console-reporter');
const path = require("path");
const SPEC_PATH = path.join(__dirname, "..", "spec.js");
const ADMIN_TOKEN_PATH = path.join(__dirname, "..", "..", "..", "object-server-for-testing", "admin_token.base64");
process.env.ADMIN_TOKEN_PATH = ADMIN_TOKEN_PATH;
// console.log(require.resolve("realm-spec-helpers"));
exports.execute = (filter) => {
const jasmine = new Jasmine();
jasmine.clearReporters();
jasmine.addReporter(new JasmineConsoleReporter({
colors: 2,
cleanStack: 3,
verbosity: 4,
activity: false
}));
jasmine.execute([ SPEC_PATH ], filter);
return jasmine;
};