Created
November 30, 2016 22:12
-
-
Save featherart/bc22f51e00f1c5d81afba51ff2b6b90c to your computer and use it in GitHub Desktop.
testing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import Ember from 'ember'; | |
export default Ember.Controller.extend({ | |
appName: 'Ember Twiddle', | |
sum(...numbers) { | |
return numbers | |
.reject(isBlank) | |
.reduce((acc, curr) => acc + curr, 0); | |
} | |
}); |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import Resolver from '../../resolver'; | |
import config from '../../config/environment'; | |
const resolver = Resolver.create(); | |
resolver.namespace = { | |
modulePrefix: config.modulePrefix, | |
podModulePrefix: config.podModulePrefix | |
}; | |
export default resolver; |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import resolver from './helpers/resolver'; | |
import { | |
setResolver | |
} from 'ember-qunit'; | |
setResolver(resolver); |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import { moduleFor, test } from 'ember-qunit'; | |
moduleFor('controller:application', 'application controller', { | |
// Specify the other units that are required for this test. | |
// needs: ['controller:foo'] | |
}); | |
// Replace this with your real tests. | |
test('#adds numbers', function(assert) { | |
let controller = this.subject(); | |
assert.equal(controller.sum(1,2,3), 6); | |
assert.equal(controller.sum(0,0,0), 0); | |
assert.notEqual(controller.sum(1,2,3), 9); | |
}); | |
test('#ignores non-numerical values', function(assert) { | |
let controller = this.subject(); | |
assert.notEqual(controller.sum('yo'), 6); | |
assert.equal(controller.sum(0, 'foo', null), 6); | |
} |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
{ | |
"version": "0.10.6", | |
"EmberENV": { | |
"FEATURES": {} | |
}, | |
"options": { | |
"use_pods": false, | |
"enable-testing": true | |
}, | |
"dependencies": { | |
"jquery": "https://cdnjs.cloudflare.com/ajax/libs/jquery/1.11.3/jquery.js", | |
"ember": "2.9.0", | |
"ember-data": "2.9.0", | |
"ember-template-compiler": "2.9.0", | |
"ember-testing": "2.9.0" | |
}, | |
"addons": {} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment