@aslam wrote:
Hello,
I am just starting to learn Ember and currently running through the Tutorial. The guide is very clear and precisely explaining the concepts. However, I am unable to run the acceptance tests following the guide since the test runner is complaining about ‘andThen’ not being defined.
import { module, test } from 'qunit'; import { visit, currentURL } from '@ember/test-helpers'; import { setupApplicationTest } from 'ember-qunit'; module('Acceptance | list rentals', function(hooks) { setupApplicationTest(hooks); test('visiting /', function(assert) { visit('/'); andThen(function() { assert.equal(currentURL(), '/'); }); }); });
The tests fail throwing the following:
at requireModule (http://localhost:7357/assets/vendor.js:30:18) at TestLoader.require (http://localhost:7357/assets/test-support.js:10151:9): andT hen is not defined ReferenceError: andThen is not defined at Object.<anonymous> (http://localhost:7357/assets/tests.js:12:13) at runTest (http://localhost:7357/assets/test-support.js:4143:30) at Test.run (http://localhost:7357/assets/test-support.js:4129:6) at http://localhost:7357/assets/test-support.js:4335:12 at Object.advance (http://localhost:7357/assets/test-support.js:3781:26) at begin (http://localhost:7357/assets/test-support.js:5724:20) at http://localhost:7357/assets/test-support.js:4722:6 ESLint | tests: acceptance/list-rentals-test.js ✘ acceptance/list-rentals-test.js should pass ESLint 11:9 - 'andThen' is not defined. (no-undef) at Object.<anonymous> (http://localhost:7357/assets/tests.js:93:12) at runTest (http://localhost:7357/assets/test-support.js:4143:30) at Test.run (http://localhost:7357/assets/test-support.js:4129:6) at http://localhost:7357/assets/test-support.js:4335:12 at Object.advance (http://localhost:7357/assets/test-support.js:3781:26) at begin (http://localhost:7357/assets/test-support.js:5724:20) expected true
package.json
{ "name": "super-rentals", "version": "0.0.0", "private": true, "description": "Small description for super-rentals goes here", "license": "MIT", "author": "", "directories": { "doc": "doc", "test": "tests" }, "repository": "", "scripts": { "build": "ember build", "lint:js": "eslint ./*.js app config lib server tests", "start": "ember serve", "test": "ember test" }, "devDependencies": { "broccoli-asset-rev": "^2.4.5", "ember-ajax": "^3.0.0", "ember-cli": "~3.0.0", "ember-cli-app-version": "^3.0.0", "ember-cli-babel": "^6.6.0", "ember-cli-dependency-checker": "^2.0.0", "ember-cli-eslint": "^4.2.1", "ember-cli-htmlbars": "^2.0.1", "ember-cli-htmlbars-inline-precompile": "^1.0.0", "ember-cli-inject-live-reload": "^1.4.1", "ember-cli-qunit": "^4.1.1", "ember-cli-shims": "^1.2.0", "ember-cli-sri": "^2.1.0", "ember-cli-uglify": "^2.0.0", "ember-data": "~3.0.0", "ember-export-application-global": "^2.0.0", "ember-load-initializers": "^1.0.0", "ember-maybe-import-regenerator": "^0.1.6", "ember-resolver": "^4.0.0", "ember-source": "~3.0.0", "ember-welcome-page": "^3.0.0", "eslint-plugin-ember": "^5.0.0", "loader.js": "^4.2.3" }, "engines": { "node": "^4.5 || 6.* || >= 7.*" } }
Any pointers of where I am going wrong is appreciated.
Also, the code at https://github.com/ember-learn/super-rentals doesn’t seem to be updated for Ember 3.0.
Posts: 5
Participants: 2