Skip to content
This repository was archived by the owner on Dec 7, 2021. It is now read-only.

Commit e2f3a75

Browse files
committed
Merge pull request #8 from jedlinlau/master
Require react-native to access NativeModules.
2 parents c20f42c + e154e73 commit e2f3a75

File tree

2 files changed

+7
-5
lines changed

2 files changed

+7
-5
lines changed

lib/simpleauthclient.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
'use strict';
22

3-
let SimpleAuthWrapper = require('NativeModules').SimpleAuthWrapper;
3+
let SimpleAuthWrapper = require('react-native').NativeModules.SimpleAuthWrapper;
44

55
/**
66
* @class SimpleAuthClient

test/simpleauthclient.test.js

Lines changed: 6 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -12,10 +12,12 @@ describe('SimpleAuthClient', () => {
1212
configureSpy = sinon.spy();
1313
authorizeSpy = sinon.spy();
1414
simpleAuthClient = proxyquire('../lib/simpleauthclient', {
15-
NativeModules: {
16-
SimpleAuthWrapper: {
17-
configure: configureSpy,
18-
authorize: authorizeSpy
15+
'react-native': {
16+
NativeModules: {
17+
SimpleAuthWrapper: {
18+
configure: configureSpy,
19+
authorize: authorizeSpy
20+
}
1921
},
2022
'@noCallThru': true
2123
}

0 commit comments

Comments
 (0)