-
Notifications
You must be signed in to change notification settings - Fork 962
Description
[REQUIRED] Describe your environment
- Operating System version: macOS Sierra
- Firebase SDK version: 4.1.2
- Firebase Product: core (auth, database, storage, etc)
[REQUIRED] Describe the problem
Cross Posting from #26
I writing some unit for React with the Jest unit test framework but I got the following error while
TypeError: _firebase2.default.storage is not a functionHere the stacktrace :
` FAIL src/components/organisms/PriceSettingsBlock/PriceSettingsBlock.test.js
● Test suite failed to runTypeError: _firebase2.default.storage is not a function
at Object. (src/core/firebase/firebase.js:8:120)
at Object. (src/core/firebase/firebase-list.js:1:815)
at Object. (src/core/chat/eventList.js:30:77)
at Object. (src/core/chat/sagas.js:4:44)
at Object. (src/core/chat/index.js:2:62)
at Object. (src/core/init/sagas.js:3:39)
at Object. (src/core/init/index.js:1:387)
at Object. (src/components/organisms/PriceSettingsBlock/PriceSettingsBlock.js:6:39)
at Object. (src/components/organisms/PriceSettingsBlock/PriceSettingsBlock.test.js:4:53)
at handle (node_modules/worker-farm/lib/child/index.js:41:8)
at process. (node_modules/worker-farm/lib/child/index.js:47:3)
at emitTwo (events.js:106:13)
at process.emit (events.js:194:7)
at process.nextTick (internal/child_process.js:766:12)
at _combinedTickCallback (internal/process/next_tick.js:73:7)
at process._tickCallback (internal/process/next_tick.js:104:9)`
Test file is here :
PriceSettingsBlock.js.txt
PriceSettingsBlock.test.js.txtMy configuration is here:
`import firebase from 'firebase';
import { firebaseConfig } from './config';export const firebaseApp = firebase.initializeApp(firebaseConfig);
export const firebaseAuth = firebaseApp.auth();
export const firebaseDb = firebaseApp.database();
// firebase.storage() seems to be null
export const firebaseStorage = firebase.storage();`And my configuration ( config.js):
export const firebaseConfig = {
apiKey: 'my api key',
authDomain: 'my-project-id.firebaseapp.com',
databaseURL: 'https://my-project-id.firebaseio.com',
projectId: 'my-project-id',
storageBucket: 'my-project-id.appspot.com',
messagingSenderId: 'my-sender-id'
};Any idea ?
Steps to reproduce:
@jshcrowthe I have create a new project with create-react-app:
https://github.com/ataliadvanstep/firebase-jest
Just clone the project and run npm test