Skip to content
This repository was archived by the owner on Feb 26, 2024. It is now read-only.

Commit 51c5093

Browse files
authored
chore: reactivate running test in Node (#72)
Fixes #53
1 parent 304ce1f commit 51c5093

File tree

4 files changed

+7
-4
lines changed

4 files changed

+7
-4
lines changed

README.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -30,6 +30,7 @@ iOS:
3030
* OR, `gulp watch` and open `.dist/app/ngReactNative/ios/ngReactNative.xcodeproj` in Xcode and hit `Run`
3131

3232
Tests:
33+
* `gulp test.node` to run tests in Node
3334
* `gulp test.browser` to run tests in Chrome
3435

3536
Doc:

jasmine-test-shim.js

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -41,7 +41,9 @@ jrunner.addSpecFiles(specFiles);
4141

4242
var testingPlatformServer = require('@angular/platform-server/testing/server.js');
4343
var testing = require('@angular/core/testing.js');
44-
testing.setBaseTestProviders(testingPlatformServer.TEST_SERVER_PLATFORM_PROVIDERS,
45-
testingPlatformServer.TEST_SERVER_APPLICATION_PROVIDERS);
44+
45+
testing.TestBed.initTestEnvironment(
46+
testingPlatformServer.ServerTestingModule, testingPlatformServer.platformServerTesting());
47+
require('zone.js/dist/jasmine-patch.js');
4648

4749
jrunner.execute();

package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@
33
"version": "0.0.1-alpha.15",
44
"description": "A React Native renderer for Angular 2",
55
"scripts": {
6-
"test": "gulp test.browser/ci",
6+
"test": "gulp test.browser/ci && gulp test.node/ci",
77
"postinstall": "typings install"
88
},
99
"repository": {

src/events/hammer.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
if (typeof global.window === "undefined") global.window = {};
1+
if (typeof global.window === "undefined") global.window = global;
22
if (typeof global.document === "undefined") global.document = {createElement: () => {return {style: {}};}};
33
var hammer = (typeof global.window.Hammer === "undefined") ? require('hammerjs') : global.window.Hammer;
44

0 commit comments

Comments
 (0)