- xml - AJAX/Jquery XML 解析
- 具有多重继承的 XML 模式
- .net - 枚举序列化 Json 与 XML
- XML 简单类型、简单内容、复杂类型、复杂内容
我的测试有问题,当我运行它们时出现此错误:
09 09 2015 14:55:27.174:INFO [Chrome 45.0.2454 (Mac OS X 10.10.1)]: Connected on socket 9aXAoBK8a1zKw9IVAAAA with id 22794373
Chrome 45.0.2454 (Mac OS X 10.10.1) ERROR
Uncaught ReferenceError: jasmineRequire is not defined
at /Users/agarcia/Projects/affiliate-suite/node_modules/karma/jasmine/lib/boot.js:15
这是我的 karma.conf.js 文件:
/*global __dirname*/
// Karma configuration
var path = require('path');
module.exports = function(config) {
config.set({
// base path that will be used to resolve all patterns (eg. files, exclude)
basePath: __dirname,
// frameworks to use
// available frameworks: https://npmjs.org/browse/keyword/karma-adapter
frameworks: ['jasmine'],
// list of files / patterns to load in the browser
files: [
'node_modules/jasmine-core/lib/jasmine-core/jasmine.js',
'src/**/*.test.js'
],
// list of files to exclude
exclude: [],
// preprocess matching files before serving them to the browser
// available preprocessors: https://npmjs.org/browse/keyword/karma-preprocessor
preprocessors: {
'node_modules/jasmine-core/lib/jasmine-core/jasmine.js': ['webpack'],
'src/**/*.test.js': ['webpack']
},
// test results reporter to use
// possible values: 'dots', 'progress'
// available reporters: https://npmjs.org/browse/keyword/karma-reporter
reporters: ['progress'],
// web server port
port: 9876,
// enable / disable colors in the output (reporters and logs)
colors: true,
// level of logging
// possible values: config.LOG_DISABLE || config.LOG_ERROR || config.LOG_WARN || config.LOG_INFO || config.LOG_DEBUG
logLevel: config.LOG_INFO,
// enable / disable watching file and executing tests whenever any file changes
autoWatch: true,
// start these browsers
// available browser launchers: https://npmjs.org/browse/keyword/karma-launcher
browsers: ['Chrome'],
// Continuous Integration mode
// if true, Karma captures browsers, runs the tests and exits
singleRun: false,
plugins: [
require('karma-jasmine'),
require('karma-chrome-launcher'),
require('karma-webpack')
]
});
};
我已经安装了:
有什么线索吗?
最佳答案
阅读本文是找到解决此问题的关键:
http://jasmine.github.io/2.0/boot.html
它说 jasmine.js
和 jasmine-html.js
必须在 boot.js
之前加载,所以我所做的是将它们按顺序排列,它根本不起作用,但我查看了 jasmine-core 文件夹,我发现了一个名为 jasmine-core.js
的文件,它以正确的顺序加载所有内容。
效果很好!
关于javascript - Uncaught ReferenceError : jasmineRequire is not defined,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/32480354/
描述:。在我的Vue 3和nuxt 3项目中,我使用VITEST进行测试。但我在运行测试时遇到了一个问题:。版本。以下是我的页面代码:。下面是我的测试myest.spec.ts:。以下是我的vites
你好吗?我正在研究带有 Ionic 3 教程的 Google map 。我已经完成了那里解释的一切,但是当项目启动时,出现了这个错误。我调查了很多,但没有任何效果。谢谢! Error: Uncaugh
我刚刚开始使用 Node.js 并尝试使用模块。我已经安装了 Node 和 npm,并确保一切顺利。我将在下面添加代码来向您展示我得到了什么。 我有两个 js 文件,它们在这里。 app.js: va
我是 Angularjs 的初学者,在理解模块和作用域方面有些困难。 我不断收到范围未定义的错误,但我不明白为什么。首先,我将 Controller 链接到我设置路由的位置,但是由于在单击提交按钮时调
我正在制作一个 HTML 模板引擎。 程序遍历 HTML,并找到 {{ }} 的所有实例。然后它会遍历计数器中的所有键,并用对 Controller 的引用替换变量名称的实例。 例如,如果我的 Con
在我的 React Native 应用程序中,我有一个 ProductScreen,其中导入两个文件来完成屏幕。 文件 1 (Products.js) 是我的产品列表 文件 2 (Data.js) 是
我有以下类(class): class ScheduledContent { constructor(knex) { this.knex = knex } ge
在以下代码中,obj.sayhello() 行意味着sayhello在 obj 的上下文/范围内执行。 str未在 var 中定义(通过 sayhello )方法。 JS 将在范围内查找变量,即在
我正在尝试使用字符串作为函数的一部分。 const import1 = require('./import1'); const import2 = require('./import2'); //on
var g = { lang: "ttt", l: function(){ console.log(lang); } } console.log(g.l());
$(document).ready(function(){ $('#name').val('Name1'); }); function clickMe(){ console.lo
我刚刚完成了 Meteor 包的开发。现在我想通过将它添加到新的 Meteor 应用程序来测试它: my_cool_package_name/package.js Package.on_use(fun
我在给定的 SSCCE 代码中收到以下错误: Error: ReferenceError: electron is not defined Source File: http://localhost/
我正在关注一个简单的 tut,它有望构建一个响应式 slider ,但是它一直告诉我控制台中有一个错误指向一个名为 advance() 的函数 这是 slider 的简单 html:
我正在尝试使用基于按钮点击的表格中的数据填充表格。我正在将数据传递到 javascript 函数中。 )" id="modifyEdu" class="btn btn-primary"
我需要能够检查一个变量是否存在(如果它没有分配给 {})而不在 javascript 中抛出错误。当我尝试这段代码时 if (a) {} 它抛出 Uncaught ReferenceError
我在设置中有一个 mochajs 测试文件和一个 javascript 代码文件,如下所示: /js/module/codefile.js /js/test/testfile.js codefile.
我正在尝试构建一个简单的 Bookmarklet,它将一些外部 Javascript 加载到页面中,目标是将像 Stackoverflow 那样的 Markdown 编辑器添加到另一个站点。我可以使用
我有一个基于 Django 的网络应用程序。我用 Scrapy Crawler抓取网页。目前,我的目标是能够使用 jQuery 和 AJAX 请求从网页内控制爬虫。 我的理论设置如下: 在网页上,我有
以下 JavaScript... if (eval('typeof admin_post_css_theme_dark-moon)=='function')) {/**/} ...触发以下错误消息..
我是一名优秀的程序员,十分优秀!