This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
node_modules | |
packageA | |
packageB | |
typeorm x.y.z |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
packageA | |
peerDependency: typeorm >= x.y.z | |
packageB | |
dependency: typeorm x.y.z |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
$ cd <package> | |
$ yarn link | |
$ cd <project> | |
$ yarn link <package> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
package main | |
import ( | |
"fmt" | |
"io/ioutil" | |
"log" | |
"os" | |
"os/exec" | |
"path" | |
"path/filepath" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import sys | |
import os | |
import fnmatch | |
from PIL import Image | |
imageSource = os.path.join( | |
"C:\\", "Users", "stern", "Google 드라이브", "기타", "Goodnotes4Export" | |
) | |
outputPath = os.path.join( | |
"C:\\", "Users", "stern", "Google 드라이브", "기타", "output" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
it("should test `onUserCreate`", async () => { | |
const wrapped = testEnv.wrap(api.onUserCreate); | |
const testUser = { | |
uid: "122", | |
displayName: "lee" | |
}; | |
await wrapped(testUser); | |
// generate user returns newUser object below |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import functions from "firebase-functions-test"; | |
import * as admin from "firebase-admin"; | |
import { generateNewUser } from "../lib"; | |
const testEnv = functions(); | |
/** | |
* mock setup | |
*/ | |
const mockSet = jest.fn(); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
describe("my functions", () => { | |
let adminStub, api; | |
beforeAll(() => { | |
// you can use `sinon.stub` instead | |
adminStub = jest.spyOn(admin, "initializeApp"); | |
// after initializeApp call, we load our functions | |
api = require("../index"); | |
}); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import functions from "firebase-functions-test"; | |
import * as admin from "firebase-admin"; | |
import * as path from "path"; | |
// you can check all these information in firebase console/settings | |
const projectConfig = { | |
projectId: "projectId", | |
databaseURL: "databaseURL" | |
}; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// this config includes typescript specific settings | |
// and if you're not using typescript, you should remove `transform` property | |
module.exports = { | |
transform: { | |
'^.+\\.tsx?$': 'ts-jest', | |
}, | |
testRegex: 'src(/__tests__/.*|(\\.|/)(test|spec))\\.(jsx?|tsx?)$', | |
testPathIgnorePatterns: ['lib/', 'node_modules/'], | |
moduleFileExtensions: ['ts', 'tsx', 'js', 'jsx', 'json', 'node'], | |
testEnvironment: 'node', |