gpt4 book ai didi

javascript - 为什么我得到 'There is no timestamp for/base/src/tests/core/types.tests!' ?

转载 作者:数据小太阳 更新时间:2023-10-29 05:57:56 25 4
gpt4 key购买 nike

<分区>

我花了几个小时想弄明白,我想这与我配置错误的 requirejs 文件(“test.main.js”)有关,但我不太确定,所以有人可以向我解释一下吗怎么了?

如果您需要我提供更多信息,我很乐意提供。

这是堆栈跟踪的输出。

Eyal Shilony@LIONKING /d/Projects/Code/Development/tsToolkit
$ ./karma.sh start
INFO [karma]: Karma v0.12.16 server started at http://localhost:8380/
INFO [IE 11.0.0 (Windows 7)]: Connected on socket GCSNAkUAY24F-MN7dkGQ with id manual-4464
IE 11.0.0 (Windows 7) ERROR: 'There is no timestamp for /base/src/tests/core/types.tests!'

WARN [web-server]: 404: /base/src/tests/core/types.tests
IE 11.0.0 (Windows 7) ERROR
Script error for: /base/src/tests/core/types.tests
http://requirejs.org/docs/errors.html#scripterror
at D:/Projects/Code/Development/tsToolkit/node_modules/requirejs/require.js:141

这是我使用 atm 的目录结构。

.
|-- WebEssentials-Settings.json
|-- jake.sh
|-- jakefile.js
|-- karma.sh
|-- node_modules
| |-- jake
| | |-- Jakefile
| | |-- Makefile
| | |-- README.md
| | |-- bin
| | |-- lib
| | |-- node_modules
| | |-- package.json
| | `-- test
| |-- jasmine-node
| | |-- Gruntfile.coffee
| | |-- LICENSE
| | |-- README.md
| | |-- bin
| | |-- bower.json
| | |-- index.js
| | |-- lib
| | |-- node_modules
| | |-- package.json
| | |-- scripts
| | |-- spec
| | `-- src
| |-- karma
| | |-- CHANGELOG.md
| | |-- LICENSE
| | |-- README.md
| | |-- bin
| | |-- config.tpl.coffee
| | |-- config.tpl.js
| | |-- config.tpl.ls
| | |-- karma-completion.sh
| | |-- lib
| | |-- node_modules
| | |-- package.json
| | |-- requirejs.config.tpl.coffee
| | |-- requirejs.config.tpl.js
| | `-- static
| |-- karma-jasmine
| | |-- LICENSE
| | |-- README.md
| | |-- lib
| | `-- package.json
| |-- karma-requirejs
| | |-- LICENSE
| | |-- README.md
| | |-- lib
| | `-- package.json
| |-- karma-requirejs-preprocessor
| | `-- index.js
| |-- requirejs
| | |-- README.md
| | |-- bin
| | |-- package.json
| | `-- require.js
| `-- shelljs
| |-- LICENSE
| |-- README.md
| |-- bin
| |-- global.js
| |-- make.js
| |-- package.json
| |-- scripts
| |-- shell.js
| `-- src
|-- scratchpad.txt
|-- src
| |-- app.main.js
| |-- app.main.js.map
| |-- app.main.ts
| |-- framework
| | |-- core
| | |-- css
| | `-- widgets
| |-- index.html
| |-- libs
| | |-- jquery-2.1.0.js
| | |-- require.js
| | `-- typings
| |-- tests
| | |-- core
| | `-- test.main.js
| |-- tsToolkit.csproj
| |-- tsToolkit.csproj.user
| |-- web.Debug.config
| |-- web.Release.config
| `-- web.config
|-- tools
| |-- karma
| | |-- karma.conf.js
| | `-- karma.conf.js.back
| `-- mocha
| `-- mocha.ext.js
|-- tsToolkit.sln
|-- tsToolkit.sln.DotSettings.user
`-- tsToolkit.v12.suo

41 directories, 59 files

这是 Karma 的配置文件。

// Karma configuration
// Generated on Fri May 16 2014 08:27:07 GMT+0300 (Jerusalem Daylight Time)

module.exports = function(config) {
config.set({

// base path that will be used to resolve all patterns (eg. files, exclude)
basePath: '../../',


// frameworks to use
// available frameworks: https://npmjs.org/browse/keyword/karma-adapter
frameworks: ['jasmine', 'requirejs'],


// list of files / patterns to load in the browser
files: [
{pattern: 'src/libs/*.js', included: false},
{pattern: 'src/framework/**/*.js', included: false},
{pattern: 'src/tests/**/*tests.js', included: false},
'src/tests/test.main.js'
],


// list of files to exclude
exclude: [
'src/app.main.js'
],


// preprocess matching files before serving them to the browser
// available preprocessors: https://npmjs.org/browse/keyword/karma-preprocessor
preprocessors: {

},


// test results reporter to use
// possible values: 'dots', 'progress'
// available reporters: https://npmjs.org/browse/keyword/karma-reporter
reporters: ['progress'],


// web server port
port: 8380,


// 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: [],


// Continuous Integration mode
// if true, Karma captures browsers, runs the tests and exits
singleRun: false
});
};

最后是我的“test.main.js”文件,用于为 Karma 设置 requirejs。

var tests = [];
for (var file in window.__karma__.files) {
if (window.__karma__.files.hasOwnProperty(file)) {
if (/\.tests\.js$/.test(file)) {
tests.push(file.replace(/\.js$/, ""));
}
}
}

requirejs.config({
baseUrl: '/base',
deps: tests,
callback: window.__karma__.start
});

25 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com