如果我的网站有问题,我编写了下面的bash脚本来向我发送警告:
#!/bin/bash
# 1. download the page
BASE_URL="https://www.example.com/ja"
JS_URL="https://www.example.com/"
# # 2. search the page for the following URL: /sites/default/files/google_tag/google_tag.script.js?[FIVE-CHARACTER STRING WITH LETTERS AND NUM
我的詹金斯正在CentOS 6上运行node.js 0.10.15和bower 1.0.3。
我有一个shell任务,它执行以下操作:
npm install
bower install
grunt clean package
建造时,保龄球安装失败:
+ bower install
path.js:360
throw new TypeError('Arguments to path.join must be strings');
^
TypeError: Arguments to path.join must be strings
我试着用Jest用酶对我的反应应用程序进行单元测试,但是得到了这个错误。
失败src/components/XYZ/tests/ABC.test.js
测试套件无法运行
SyntaxError: Name argument is not a valid custom element name.
测试套件:2次失败,2次总测试:0次总快照:0次总时间: 3.224秒跑完所有测试箱。
我的Jest Config文件如下
"jest": {
"moduleNameMapper": {
"d3": "<rootDir&g
我已经设置了spec/javascripts/spec.js.coffee,并且在spec/javascripts中有一个带有3个测试的spec文件。当我在浏览器中运行jasmine时,会运行3个测试。
当我运行guard时,它启动并运行guard-jasmine,它会找到并运行我的所有测试,如下所示:
$ bundle exec guard
Guard uses GNTP to send notifications.
Guard is now watching at '/workpath'
Guard::Jasmine starts Unicorn test server o
我正在使用Nightwatch.js测试自动化框架。
在我的代码中,我得到了这个值,但是我不能将这个记录的值传递给另一个函数。以下是代码:
CreateLife: function (browser) {
browser.getValue('#LifeID', function (r) {
a = r.value;
browser.execute(function () {
LifeTemplatesManager.loadAddOnlineItem(a); //doesn't work/The va
在尝试设置测试环境时,我遇到了以下问题。当我运行测试(使用mocha ./src/test/.setup.js ./src/test/**.test.js)时,我得到一个Element is not defined错误:
app\node_modules\onsenui\js\onsenui.js:603
var originalCreateShadowRoot = Element.prototype.createShadowRoot;
^
ReferenceError: Element is not defined
当我部署Lambda函数时,我会得到这个错误:
module initialization error: Error
at Error (native)
at Object.Module._extensions..node (module.js:597:18)
at Module.load (module.js:487:32)
at tryModuleLoad (module.js:446:12)
at Function.Module._load (module.js:438:3)
at Module.require (module.js:497:17)
at require (interna
在运行一个简单的节点程序时,我得到了这个错误:
/home/ubuntu/parent.js:4
throw error;
^
Error: Command failed: /bin/sh: 1: node: not found
at ChildProcess.exithandler (child_process.js:637:15)
at ChildProcess.EventEmitter.emit (events.js:98:17)
at maybeClose (child_process.js:735:16)
at Socket.<anonymous>
我试图操纵一个在模块中调用的函数,使其为true,然而,如果模块没有将函数封装到对象上,我如何模拟函数的值呢?
// app.js
function start(foo) {
if (isGood(foo)) initialize(foo)
}
function isGood = function(name) {
return dosomething_really_complicated_here(name) // i dont care about this, and actuallyi want to mock its return value
}
我下载了,我可以成功地运行"ng测试“或"npm运行测试”(我理解这两种方法完全一样)。
C:\_pocs\ws_vsc\pastebin-angular-master>npm run test
> test-angular@0.0.0 test C:\_pocs\ws_vsc\pastebin-angular-master
> ng test
10% building modules 1/1 modules 0 active29 12 2017 18:13:27.927:WARN [karma]: No captured
我编写的函数将包含在所有页面中,它将为所有POST头提供CSRF令牌。因为我希望它出现在所有的页面上,所以我把它包含在我的common.js文件中,这个文件是由webpack创建的,加载在页面的头上。
function setupAjaxCsrfToken(){
var csrf_token = $('meta[name="csrf-token"]').attr('content');
$.ajaxPrefilter(function(options, originalOptions, jqXHR){
if (op
我正在尝试让Karma/Babel/Jasmine/Aurelia一起工作,但是我在运行karma start时遇到这个错误
Chrome 50.0.2661 (Windows 10 0.0.0) ERROR
SystemJS was not found. Please make sure you have initialized jspm via installing a dependency with jspm, or by running 'jspm dl-loader'.
system.js文件位于lib文件夹中。
我的文件夹结构:
> Web
karma.c