我正在尝试在我的 GitLab CI 管道上测试 Firestore 的安全规则。我需要运行 Firebase 的模拟器来实现这一点。
但是,Firebase 模拟器基本上开始提供“假后端”服务。那么,我如何才能与其他作业并行运行该作业?
例如:
stages:
- emulator
- test
emulator:
- stage: emulator
script:
- firebase serve --only firestore
test:
- stage: test
script:
- yarn test
Run Code Online (Sandbox Code Playgroud)
该test作为GitLab正在接受服务的阶段从未达到emulator的阶段。因此,它永远不会结束。
continuous-integration gitlab firebase firebase-tools google-cloud-firestore
VSCode无法识别Jest类型。我收到以下错误:
Cannot find name 'describe'. Do you need to install type definitions for a test runner? Try `npm i @types/jest` or `npm i @types/mocha` and then add `jest` or `mocha` to the types field in your tsconfig.
Run Code Online (Sandbox Code Playgroud)
我已经安装@types/jest并添加jest到文件中的types字段,tsconfig但无法正常工作。
但是我注意到,它仅在子目录中发生,因为我具有具有以下文件结构的monorepo:
- app1
- app2
- app3
Run Code Online (Sandbox Code Playgroud)
如果仅打开app1文件夹,则不会出现任何错误。如何设置VSCode以与具有多个项目的文件夹一起使用?
我知道VSCode允许我们设置多个工作区,但这不是我想要的。每个文件夹都有自己node_modules的tsconfig文件。我只希望VSCode为每个文件夹识别它们,而不是查看的根级别node_modules。
我还尝试tsconfig在根级别创建一个文件,添加以下内容:
{
"compilerOptions": {
"typeRoots": ["app1/node_modules/@types", "app2/node_modules/@types"]
}
}
Run Code Online (Sandbox Code Playgroud)
但这没有用。