Setting a global timeout in Ember-cli for Qunit

I cannot find anywhere that it is documented for ember-cli to set a global timeout for QUnit.I have found the documentation for QUnit: (default: undefined)Type: NumberSpecify a global timeout in milliseconds after which all tests will fail with an appropriate message. Useful when async tests aren't finishing, to prevent the testrunner getting stuck. Set to something high, e.g. 30000 (30 seconds) to avoid slow tests to time out by accident.I was able to change this inside of \node_modules\ember-cli...Read more

Ember 2.5 ember-cmi-mirage trying to get a subset of collection

Using ember 2.5 and ember-cli-mirage 0.2)In my mirage/config.js , I am trying to get a subset ofa collection, for pagination purpose) using the slice() functionvar books =, endItem );but I get an error: is not a functionI tried also , same error var books =;var items = books.slice(startItem, endItem );Here is my mirage/config.js export default function() { .... this.get('/books', function(schema, request) { const pageNumber = request...Read more

Why is ic-ajax not defined within certain functions in Ember CLI?

Forgive my ignorance, but I can't get ic-ajax working inside of certainfunctions. Specifically, I'd like to get a test like this working, but for Ember CLI:e.g. can call ajax inside Ember.Object.Extend and outside of functions and object definitions, but not in modules, tests, or Ember.Route's model function.Am I misunderstanding something or is there a misconfiguration in my app?I've figured out that within functions I can do:ajax = require('ic-ajax')['default'];defineFixture =...Read more

How to extend an ember-cli addon?

In my ember-cli app i have installed an addon called 'ember-cli-selectize'. Looking at the directory structure i can see that its files are located at /node_modules/ember-cli-selectize'. Now i want to create a custom component that extends this addon. How do i import/require it? I've tried these and none seems to work:var EmberSelectize = require('/ember-cli-selectize/app/components/ember-selectize');import EmberSelectize from 'components/ember-selectize';import EmberSelectize from 'node_modules/ember-cli-selectize/addon/components/ember-select...Read more

How can I use ember-simple-auth with ember-cli?

I'm trying to adapt the instructions on for an app build using v0.0.28 of ember-cli. I am fairly new to ember-cli and use of AMD modules. Can anyone help with the proper way/place to import ember-simple-auth rather than the global namespace as covered in the README?The following initializer import SimpleAuth from 'vendor/ember-simple-auth/amd/ember-simple-auth';export default { name: 'authentication', initialize: function(container, application) { SimpleAuth.setup(container, application); }}Is...Read more

Ember Simple Auth 1.0 in Acceptance Tests

I'm trying to upgrade an Ember CLI app to use Simple Auth 1.0. My acceptance tests no longer work. I have configured the test suite to run against a Rails server which is a copy of my API. To log in I was doing this:visit("/")fillIn(".identification-field", "");fillIn(".password-field", "testpassword");click(".btn.login-submit");andThen(function(){ equal(currentSession(application).get('user_email'), "");});This worked with simple-auth 0.7.3 but not with 1.0.0. I have added additional methods my application route to...Read more

ember cli - ReferenceError: Can't find variable: define at http://localhost:7357/assets/test-loader.js, line 3

I'm upgrading my Ember CLI addon from 0.1.9 to 0.2.0, and am hitting this error when running ember test --server: ReferenceError: Can't find variable: define at http://localhost:7357/assets/test-loader.js, line 3ember serve works, and I can visit /tests in the browser, but something else seems to have broken the testem/phantom setup.I've upgraded Phantom, and went through the ember init diffs several times, but I must still be missing something....Read more

How can I fix tests in Ember testem with errors such as 'could not load', 'failed', 'could not find module' or 'died'?

I managed to get a couple of EAK/grunt based Ember apps upgraded to 1.11 with HTMLBars, and then got them migrated to Ember CLI/Brocolli. The unit tests were setup for karma test runner so I'm looking at how to get those running in the CLI projects now, but I didn't write the tests and really have no experience with unit testing javascript modules.Searching around the iNet, I can see that others have also used karma becasue of its coverage output and are trying to get it to work with Ember CLI, but that Ember Core isn't supporting it, though th...Read more

Ember CLI doesn't run jshint or load any tests

So this used to work all fine, but ever since I updated ember-cli from 0.1.8 to 0.1.12 my tests won’t start and jshint never checks the files I work with on save.ember testversion: 0.1.12Built project successfully. Stored in “/[...]/tmp/class-tests_dist-h3LlgY3C.tmp".1..0tests 0pass 0fail 0And on http://localhost:4200/tests it looks fine but 0 assertions of 0 passed, 0 failed..I’ve followed the upgrade path, and I don’t think I’ve missed any dependencies on my bower.json or package.json. Can any one here spot if there’s some dependency that’s...Read more

Ember-cli: importing blanket.js causes test runners to hang

I'm currently using ember-cli with ember-qUnit for testing. I would also like to add code coverage results to the test output, so after some research blanketjs seemed the way to go. I installed blanket using: npm install blanketAnd moved the blanket folder into the ember-cli vendor folder. As I understand the way to import libraries is through the Brocfile.js which I am doing like so: app.import('vendor/blanket/dist/qunit/blanket.js');Using ember inspector it appears that blanket has been imported correctly, and the "enable coverage" checkbo...Read more

Could not find module `ember-cli/test-loader`

I have recently updated my project to ember-cli@2.8. I am getting the following error when running thests ember testDoes anyone know what the issue might be? I can see it has been removed from here.not ok 1 PhantomJS 2.1 - Global error: Error: Could not find module `ember-cli/test-loader` imported from `(require)` at http://localhost:7357/assets/vendor.js, line 228 --- Log: | { type: 'error', text: 'Error: Could not find module `ember-cli/test-loader` imported from `(require)` at http://localhost:7357/assets/v...Read more

ember cli - How can I access currently processed Broccoli trees from an addon's index.js file?

I am working on a new in-repo addon, and I want to copy a file from the public tree to my own addon's namespace.I've specified that my addon should run after broccoli-asset-rev, because the file I want is the assetMap.json file generated by this plugin.I've been able to use treeForAddon to write new files to my own addon's namespace (which I can then import in my application code), but my question is, can I read from the currently-built public tree in this hook? Ideally I'd like to do something like this:module.exports = { name: 'my-new-addon'...Read more

broccolijs - How to write files into the app tree in ember-cli preprocessTree hook

I have a broccoli plugin which does the following: Read json file from root folderbased on the JSON generate some route template HBS filesThis works perfectly and can also be acceptance tested by triggering a broccoli build.Example result of the broccoli build:templates/generated-route.hbstemplates/my-sub/generated.hbsThe next phase is integrating it into an ember-addon, and I created one with a preprocessTree hook. module.exports = { name: 'route-template-generator', included(app) { this._super.included.apply(this, arguments); this.opt...Read more

Cannot read property 'then' of undefined when installing ember-cli-coffeescript

Upon installing ember-cli i wanted to install the coffeescript add on using:ember install ember-cli-coffeescriptas shown in the documentation but I get the error:WARNING: Skipping npm install: package.json not foundpackage.json not foundCannot read property 'then' of undefinedTypeError: Cannot read property 'then' of undefined at (/home/daniel/.nvm/versions/node/v7.6.0/lib/node_modules/ember-cli/lib/tasks/addon-install.js:43:7)at (/home/daniel/.nvm/versions/node/v7.6.0/lib/node_modules/ember-cli/lib/commands/install.js:39:...Read more

How to use a custom Express server with Ember CLI?

I'm using Ember CLI 0.0.36. When I run ember server in my project folder, my understanding is that a server buried in some Brocoli process gets started. However I would like to program a custom Express server and have my app point to that Node.js code for its backend. How would I go about doing that within the Ember CLI framework?UPDATE:Following @user3155277's answer, I added an adapter file like so:app-name/app/adapters/application.js:import DS from 'ember-data';export default DS.RESTAdapter.reopen({ namespace: 'api' });I created an Express s...Read more