-
Notifications
You must be signed in to change notification settings - Fork 15
/
mocha.start.js
44 lines (37 loc) · 1.09 KB
/
mocha.start.js
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
'use strict'
// prepare environment for js-data-adapter-tests
var JSData = require('js-data')
var JSDataAdapterTests = require('./node_modules/js-data-adapter/dist/js-data-adapter-tests')
var JSDataFirebase = require('./')
require('dotenv').config()
var firebase = require('firebase')
if (!process.env.DATABASE_URL) {
throw new Error('You must set the DATABASE_URL environment variable!')
}
firebase.initializeApp({
databaseURL: process.env.DATABASE_URL,
serviceAccount: process.env.KEY_FILENAME || 'key.json'
})
var assert = global.assert = JSDataAdapterTests.assert
global.sinon = JSDataAdapterTests.sinon
JSDataAdapterTests.init({
debug: false,
JSData: JSData,
Adapter: JSDataFirebase.FirebaseAdapter,
adapterConfig: {
debug: false,
db: firebase.database()
},
// js-data-firebase does NOT support these features
xfeatures: [
'findAllOpNotFound',
'filterOnRelations'
]
})
describe('exports', function () {
it('should have correct exports', function () {
assert(JSDataFirebase)
assert(JSDataFirebase.FirebaseAdapter)
assert(JSDataFirebase.version)
})
})