草庐IT

test_client

全部标签

node.js - "npm"如何运行 "npm test"?

我一直认为npmtest命令只是启动我将在scripts:{test:...}中的package.json中编写的内容>部分。但是当它不起作用时,我会遇到这个奇怪的错误。所以,我在package.json中有这段配置"scripts":{"start":"nodeindex.js","test":"mochatests/spec.js"}当我尝试运行测试时,我在终端中输入npmtest并出现以下错误:module.js:340throwerr;^Error:Cannotfindmodule'commander'但是当我只输入mochatests/spec.js时一切正常。任何想法为什么

node.js - "npm"如何运行 "npm test"?

我一直认为npmtest命令只是启动我将在scripts:{test:...}中的package.json中编写的内容>部分。但是当它不起作用时,我会遇到这个奇怪的错误。所以,我在package.json中有这段配置"scripts":{"start":"nodeindex.js","test":"mochatests/spec.js"}当我尝试运行测试时,我在终端中输入npmtest并出现以下错误:module.js:340throwerr;^Error:Cannotfindmodule'commander'但是当我只输入mochatests/spec.js时一切正常。任何想法为什么

unit-testing - Node assert.throws 未捕获异常

鉴于此代码:varassert=require('assert');functionboom(){thrownewError('BOOM');}assert.throws(boom(),Error);我得到这个输出,Node为0.4.9:node.js:134throwe;//process.nextTickerror,or'error'eventonfirsttick^Error:BOOMatboom([EDITED]/assert.throws.test.js:4:9)atObject.([EDITED]/assert.throws.test.js:7:17)atModule._c

unit-testing - Node assert.throws 未捕获异常

鉴于此代码:varassert=require('assert');functionboom(){thrownewError('BOOM');}assert.throws(boom(),Error);我得到这个输出,Node为0.4.9:node.js:134throwe;//process.nextTickerror,or'error'eventonfirsttick^Error:BOOMatboom([EDITED]/assert.throws.test.js:4:9)atObject.([EDITED]/assert.throws.test.js:7:17)atModule._c

javascript - Angular 2 Karma Test 'component-name' 不是已知元素

在AppComponent中,我在HTML代码中使用了导航组件。用户界面看起来不错。执行ngserve时没有错误。当我查看应用程序时,控制台中没有错误。但是当我为我的项目运行Karma时,出现了错误:Failed:Templateparseerrors:'app-nav'isnotaknownelement:1.If'app-nav'isanAngularcomponent,thenverifythatitispartofthismodule.2.If'app-nav'isaWebComponentthenadd'CUSTOM_ELEMENTS_SCHEMA'tothe'@NgModu

javascript - Angular 2 Karma Test 'component-name' 不是已知元素

在AppComponent中,我在HTML代码中使用了导航组件。用户界面看起来不错。执行ngserve时没有错误。当我查看应用程序时,控制台中没有错误。但是当我为我的项目运行Karma时,出现了错误:Failed:Templateparseerrors:'app-nav'isnotaknownelement:1.If'app-nav'isanAngularcomponent,thenverifythatitispartofthismodule.2.If'app-nav'isaWebComponentthenadd'CUSTOM_ELEMENTS_SCHEMA'tothe'@NgModu

http - docker客户端(docker 1.12/centos)http : server gave HTTP response to HTTPS client

在centos7上设置docker1.12。docker是使用systemd和以下命令行启动的(根据systemctlstatusdocker):/usr/bin/dockerd-D--tls=false--tlscert=/var/docker/server.pem--tlskey=/var/docker/serverkey.pem-Htcp://10.10.2.1:2376那我想在本地机器上检查一下,设置如下环境变量:DOCKER_HOST=tcp://10.10.2.1:2376DOCKER_TLS_VERIFY=0DOCKER_MACHINE_NAME=default然后用do

http - docker客户端(docker 1.12/centos)http : server gave HTTP response to HTTPS client

在centos7上设置docker1.12。docker是使用systemd和以下命令行启动的(根据systemctlstatusdocker):/usr/bin/dockerd-D--tls=false--tlscert=/var/docker/server.pem--tlskey=/var/docker/serverkey.pem-Htcp://10.10.2.1:2376那我想在本地机器上检查一下,设置如下环境变量:DOCKER_HOST=tcp://10.10.2.1:2376DOCKER_TLS_VERIFY=0DOCKER_MACHINE_NAME=default然后用do

unit-testing - 如何使用 GitLab CI 设置 Selenium E2E 测试?

我正在为网站前端开发一个Vue.js应用程序。对于这个应用程序,我想使用单元和E2E测试。我用vue-cli构建了我的项目.据我了解,vue-cli使用Karma进行单元测试,使用Nightwatch+Selenium进行E2E测试。我的.gitlab-ci.yml如下所示:stages:-testtest:express:image:node:boronstage:testscript:-cdbackend/-npminstall--progress=false-./node_modules/.bin/jasminetest:vue:image:node:boronstage:tes

unit-testing - 如何使用 GitLab CI 设置 Selenium E2E 测试?

我正在为网站前端开发一个Vue.js应用程序。对于这个应用程序,我想使用单元和E2E测试。我用vue-cli构建了我的项目.据我了解,vue-cli使用Karma进行单元测试,使用Nightwatch+Selenium进行E2E测试。我的.gitlab-ci.yml如下所示:stages:-testtest:express:image:node:boronstage:testscript:-cdbackend/-npminstall--progress=false-./node_modules/.bin/jasminetest:vue:image:node:boronstage:tes