chore: init

This commit is contained in:
Kyle Fang
2020-10-04 00:59:52 +08:00
commit 6dee113302
5 changed files with 5116 additions and 0 deletions

2
.gitignore vendored Normal file
View File

@@ -0,0 +1,2 @@
node_modules
*.log

13
babel.config.js Normal file
View File

@@ -0,0 +1,13 @@
module.exports = {
presets: [
[
'@babel/preset-env',
{
targets: {
node: 'current',
},
},
],
],
};

11
hello.test.ts Normal file
View File

@@ -0,0 +1,11 @@
import * as firebase from '@firebase/rules-unit-testing';
beforeEach(() => firebase.clearFirestoreData({projectId: 'hello'}))
afterAll(() => Promise.all(firebase.apps().map(a => a.delete())))
test('hello', () => {
const db = firebase.initializeTestApp({projectId: 'hello'}).firestore()
const adminDb = firebase.initializeAdminApp({projectId: 'hello'}).firestore()
firebase.assertSucceeds(adminDb.collection('sup').add({hello: 'world'}))
firebase.assertSucceeds(db.collection('hello').add({hello: 'world'}))
})

14
package.json Normal file
View File

@@ -0,0 +1,14 @@
{
"scripts": {
"test": "jest"
},
"dependencies": {
"@babel/core": "^7.11.6",
"@babel/preset-env": "^7.11.5",
"@firebase/rules-unit-testing": "^1.0.5",
"@types/jest": "^26.0.14",
"babel-jest": "^26.3.0",
"jest": "^26.4.2",
"typescript": "^4.0.3"
}
}

5076
yarn.lock Normal file

File diff suppressed because it is too large Load Diff