You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
The docs are lacking. If you're new to ember, your docs aren't very understandable, there are some things inferred that I'm not familiar yet with ember. Yes I've looked at the Ember docs, still, ember-mocha doesn't help much in terms of install instructions.
also it looks like if I just install mocha, I can use it or do I still need to use this plugin? Maybe it's that webstorm is resoving mocha syntax because I've got mocha installed but still need to be using ember-mocha??
I ran ember install ember-cli-mocha from terminal in the root folder of my ember app.
Then tried to setup a test like so:
/tests/my-test.js
import { describeModule, it } from 'ember-mocha';
let chai = require('chai'),
expect = chai.should();
describeModule('Companies - List', () => {
it('should display a list of companies ', () => {
expect($('tr.companies').to.have.length(2));
});
});
I don't know what I'm missing here. This test is in /tests in my Ember app.
I get the error Unexpected token import for my import line above after running mocha test command in my terminal.
Obviously I'm not setting this up right, and I don't really know about how resolvers work with Ember yet, so your docs are lacking. How do I set this up correctly?
Did I setup my test ok? what am I missing?
And..how does this resolver work? Where do I actually put this code?
import resolver from './helpers/resolver';
import { setResolver } from 'ember-mocha';
setResolver(resolver);
pretend I've never used Ember...can you please give more details on what I'm missing or doing wrong here?
The text was updated successfully, but these errors were encountered:
When running ember install ember-cli-mocha, make sure to type Y when prompted "Overwrite tests/test-helper.js". This file will then be changed to contain:
import resolver from './helpers/resolver';
import { setResolver } from 'ember-mocha';
setResolver(resolver);
Everything else should be taken care of by installing ember-cli-mocha.
You should then be able to use the ember cli generators to create modules and corresponding tests (which will use mocha). For example: ember g controller articles will create tests/unit/controllers/articles-test.js
I believe this is explained in the ember-cli-mocha readme, but please file an issue or PR there if any clarification is needed.
I've just created a bare bones ember-mocha-example project so you can compare your project's settings in case you have questions.
The docs are lacking. If you're new to ember, your docs aren't very understandable, there are some things inferred that I'm not familiar yet with ember. Yes I've looked at the Ember docs, still, ember-mocha doesn't help much in terms of install instructions.
also it looks like if I just install mocha, I can use it or do I still need to use this plugin? Maybe it's that webstorm is resoving mocha syntax because I've got mocha installed but still need to be using ember-mocha??
I ran
ember install ember-cli-mocha
from terminal in the root folder of my ember app.Then tried to setup a test like so:
/tests/my-test.js
I don't know what I'm missing here. This test is in
/tests
in my Ember app.I get the error
Unexpected token import
for my import line above after runningmocha test
command in my terminal.Obviously I'm not setting this up right, and I don't really know about how resolvers work with Ember yet, so your docs are lacking. How do I set this up correctly?
Did I setup my test ok? what am I missing?
And..how does this resolver work? Where do I actually put this code?
pretend I've never used Ember...can you please give more details on what I'm missing or doing wrong here?
The text was updated successfully, but these errors were encountered: