-
Notifications
You must be signed in to change notification settings - Fork 49
Closed
Description
Here's an example of a test for generating and destroying ember g adapter foo:
it('adapter foo', function() {
var args = ['adapter', 'foo'];
return emberNew()
.then(() => emberGenerateDestroy(args, (file) => {
expect(file('app/adapters/foo.coffee'))
.to.contain("stuff");
}));
});What I want to do is to add a step here after the generator has run (but before it has been destroyed) that compiles the specified file with CoffeeScript and checks that it worked.
This will make sure we keep producing valid CoffeeScript, and should allow us to catch all kinds of bugs.
We could make our own test helper that compiles the specified file and verifies that it doesn't blow up. Something like this (just thinking out loud, this won't work):
it('adapter foo', function() {
var args = ['adapter', 'foo'];
return emberNew()
.then(() => emberGenerateDestroy(args, (file) => {
adapterFile = file('app/adapters/foo.coffee');
expect(adapterFile)
.to.contain("stuff");
expect(compileCoffee(adapterFile)).to.not.throw(Error);
// or something more contained like
compileAndExpectCoffee(adapterFile);
}));
});Reactions are currently unavailable
Metadata
Metadata
Assignees
Labels
No labels