- html - 出于某种原因,IE8 对我的 Sass 文件中继承的 html5 CSS 不友好?
- JMeter 在响应断言中使用 span 标签的问题
- html - 在 :hover and :active? 上具有不同效果的 CSS 动画
- html - 相对于居中的 html 内容固定的 CSS 重复背景?
遵循此处的指南:https://firebase.google.com/docs/functions/unit-testing
我正在尝试为我的 TS 函数编写单元测试。
这是我的 package.json:
{
"name": "functions",
"scripts": {
"lint": "tslint --project tsconfig.json",
"build": "tsc",
"serve": "npm run build && firebase serve --only functions",
"shell": "npm run build && firebase functions:shell",
"start": "npm run shell",
"deploy": "firebase deploy --only functions",
"logs": "firebase functions:log",
"test": "mocha --reporter spec"
},
"main": "lib/index.js",
"dependencies": {
"@types/algoliasearch": "^3.27.0",
"@types/axios": "^0.14.0",
"@types/nodemailer": "^4.6.0",
"@types/stripe": "^5.0.11",
"algoliasearch": "^3.27.1",
"axios": "^0.18.0",
"firebase-admin": "~5.12.0",
"firebase-functions": "^1.0.3",
"nodemailer": "^4.6.4",
"stripe": "^5.8.0",
"webpack": "^4.7.0"
},
"devDependencies": {
"@types/node": "^9.6.6",
"firebase-functions-test": "^0.1.2",
"mocha": "^5.2.0",
"ts-loader": "^4.2.0",
"tslint": "^5.8.0",
"typescript": "^2.8.3",
"webpack-cli": "^2.1.2",
"webpack-node-externals": "^1.7.2"
},
"private": true
}
最佳答案
如果我是对的,你可能会得到类似的错误
Module 'firebase-functions-test' is not listed as dependency in package.json
关于unit-testing - Firebase 函数 TypeScript 单元测试 devDependencies,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/50677994/
使用搜索,我已经找到了类似问题的一些很好的答案,但我仍然不确定我是否理解正确。 从这些答案中我了解到 dependencies需要在 devDependencies 时运行应用程序仅在开发时需要(如单
我仔细查找,找不到这个问题的直接答案。 我添加为 devDependency 的包实际上最终会出现在生产包 JS 文件中,从而影响其大小吗?或者只是 bundle 中的依赖项? 最佳答案 不,它不会影
我知道已经有很多关于dependency的区别的帖子了和 devDependency但我没有找到任何可以解释 slim 情况的解释,所以让我们在这里打开这个。 在大多数像 svelte-materia
我运行了“yo Angular”,后来意识到它安装了 1.0.8,我卸载了 Angular 组件,但是当我重新添加所有内容时,原始的 Bower.json 文件在“devDependency”下有 A
我刚刚设置了我的 Gruntfile.js 文件并加载了所有 (9) 个 devDependencies。为了安装这些 devDependencies,我使用了以下命令 npm install nam
Mobx DevTool's README指导您将其安装为开发依赖项,然后将其导入到您的代码中。这对我来说似乎是个问题,因为 devDependencies,如 this SO answer 所解释的
我们都知道,在大多数情况下,devDependencies 下列出的包不会进入您的构建。那么为什么我们要以性能的名义剥夺它们呢? 例如我看到很多关于 Moment.js 的帖子都被另一种轻量级替代方案
第一次发帖,大家好。 我正在从 Learning Less.js (Packt) 中学习 Less,并按照它的步骤设置环境(第 2 章)。 第一次使用node.js,我安装在默认目录中。此后,我创建了
我是两个 npm 模块的作者,两个模块都具有 devDependency。第一个是 simpleDbLayer。安装它: npm install simpledblayer 下载的 package.j
精简版 我的项目需要 angular-leaflet,angular-leaflet 有一个 long list of devDependencies ,包括 jQuery 2。我不想要 jQuery
Grunt 文档指出它(和任何插件)应该包含在 devDependencies 中。 package.json的部分.我可能遗漏了一些明显的东西,但我不明白为什么。如果我想部署我的应用程序的生产版本,
将任何模块放入package.json 是否有意义? dependencies当我使用 webpack 时? 当我想开发一个包时,我使用 git clone 然后 npm install , 然后 n
我知道节点/ express 。我知道 dependency 和 devDependency 之间的区别。 我正在学习 Angular 。我已经完成了官方教程。 我认为 Angular 应用程序在开发
我希望 Heroku 在推送应用程序后构建我的应用程序,这样我就不必每次进行更改时都将构建文件夹向上推送。然而,Heroku 仅安装来自 package.json 和 grunt(我的构建工具)的依赖
我安装了这个: https://www.npmjs.com/package/derequire 与 npm install derequire --save-dev 它出现在package.json文
我正在用 NodeJS 编写一个库,供其他人使用。该库的测试依赖于测试框架,因此该框架列在devDependencies中。 package.json的部分这样任何将我的库拉入他们的代码的人都不会下载
我的package.json的依赖项中有connect-assets。它的 package.json 看起来像: "dependencies": { "connect-file-cache"
我有一个如下所示的 package.json 文件: { "name": "basics", "version": "0.1.0", "private": true, "devDepe
我正在开发一个为另一个项目提供 cli 选项的项目。 cli 需要一些额外的依赖项,我已将其列为 devdependency。然而,当安装到目标项目上时,devdependency 并没有被安装。 n
有没有办法让 npm install 在单独的目录中安装 devDevpendencies,从而能够运行构建任务,同时以动态/简单的方式排除 devDependencies? 最佳答案 我不认为这是可
我是一名优秀的程序员,十分优秀!