PhantomJS中的Ember App测试失败

时间:2016-07-06 07:44:06

标签: javascript ember.js phantomjs

由于某些原因,我的ember应用程序的测试在PhantomJS中失败,但在Chrome中有效。无法弄清楚原因,PhantomJS无法找到我的应用程序的解析器。当测试以chrome运行时,这些问题都没有。

我收到以下错误。

Error: Could not find module `my-app/resolver` imported from `my-app/tests/helper
s/resolver` at http://localhost:4212/assets/vendor.js, line 173
Error: Assertion Failed: The tests file was not loaded. Make sure your tests index.html
 includes "assets/tests.js". at http://localhost:4212/assets/vendor.js, line 16463
TypeError: undefined is not an object (evaluating 'data.length') at http://localhost:42
12/assets/test-loader.js, line 115
TypeError: undefined is not an object (evaluating 'data.length') at http://localhost:42
12/assets/test-loader.js, line 115

其他信息:

ember-cli: 2.5.0
node: 0.12.14
os: darwin x64

的package.json

{
  "name": "my-app,
  "version": "1.0.0",
  "repository": "",
  "description": "Small description for my-app goes here",
  "private": true,
  "directories": {
    "doc": "doc",
    "test": "tests"
  },
  "scripts": {
    "start": "ember server",
    "build": "ember build",
    "test": "ember test"
  },
  "engines": {
    "node": ">= 0.10.0"
  },
  "author": "",
  "license": "MIT",
  "devDependencies": {
    "body-parser": "1.12.4",
    "broccoli-asset-rev": "2.4.2",
    "broccoli-jscs": "0.0.22",
    "connect-restreamer": "1.0.2",
    "ember-ajax": "0.7.1",
    "ember-cli": "2.5.0",
    "ember-cli-app-version": "1.0.0",
    "ember-cli-babel": "5.1.6",
    "ember-cli-blanket": "0.9.4",
    "ember-cli-content-security-policy": "0.4.0",
    "ember-cli-dependency-checker": "1.2.0",
    "ember-cli-document-title": "0.2.0",
    "ember-cli-htmlbars-inline-precompile": "0.3.1",
    "ember-cli-ic-ajax": "0.2.4",
    "ember-cli-inject-live-reload": "1.4.0",
    "ember-cli-qunit": "1.4.0",
    "ember-cli-release": "0.2.8",
    "ember-cli-simple-auth-cookie-store": "0.8.0",
    "ember-cli-sri": "2.1.0",
    "ember-cli-uglify": "1.2.0",
    "ember-data": "2.5.0",
    "ember-disable-proxy-controllers": "1.0.1",
    "ember-export-application-global": "1.0.5",
    "ember-load-initializers": "0.5.1",
    "ember-resolver": "2.0.3",
    "ember-sinon": "0.3.0",
    "esprima-fb": "15001.1.0-dev-harmony-fb",
    "express": "4.12.3",
    "glob": "4.5.3",
    "liquid-fire": "0.23.0",
    "loader.js": "4.0.1",
    "morgan": "1.5.3",
    "<mycustommod1>": "file:node_modules/mycustommod1",
    "<mycustommod2>": "file:node_modules/mycustommod2"
  },
  "dependencies": {
    "ember-cli-htmlbars": "1.0.3",
    "ember-cli-sass": "5.3.1"
  }
}

1 个答案:

答案 0 :(得分:0)

尝试删除"ember-cli-blanket": "0.9.4",为我工作。