Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
Browse files

Added simple spec for node

  • Loading branch information...
commit 1aa84a1d9f919d6bf8d28ac7f0eb4accf4c3058f 1 parent e006c9c
@foobarfighter authored
Showing with 31 additions and 31 deletions.
  1. +31 −31 spec/node/cli_spec.js
View
62 spec/node/cli_spec.js
@@ -39,7 +39,7 @@ foounit.add(function (kw){ with(kw){
});
after(function (){
- cleanupAsync();
+ //cleanupAsync();
});
describe('when the target directory already exists', function (){
@@ -58,52 +58,52 @@ foounit.add(function (kw){ with(kw){
var targets = ['browser', 'node, browser', 'node'];
for (var i = 0, ii = targets.length; i < ii; ++i){
- var target = targets[i];
-
- describe('when the target is for the ' + target, function (){
- var path;
+ (function (target){ // generate tests
- before(function (){
- path = pth.join(suitePath, 'spec');
- });
+ describe('when the target is for the ' + target, function (){
+ var path;
- describe('when there is no suite option', function (){
before(function (){
- options = { target: target, dir: path };
+ path = pth.join(suitePath, 'spec');
});
- it('generates a minimal test', function (){
- run(function (){
- footest.generateSuite(options);
+ describe('when there is no suite option', function (){
+ before(function (){
+ options = { target: target, dir: path };
});
- waitFor(function (){
- expect(fs.isFileSync(pth.join(path, 'example-spec.js'))).to(beTrue);
- expect(fs.isFileSync(pth.join(path, 'suite.js'))).toNot(beTrue);
- });
- });
- });
+ it('generates a minimal test', function (){
+ run(function (){
+ footest.generateSuite(options);
+ });
- describe('when the suite option is passed', function (){
- before(function (){
- options = { target: target, dir: path, suite: true };
+ waitFor(function (){
+ expect(fs.isFileSync(pth.join(path, 'example-spec.js'))).to(beTrue);
+ expect(fs.isFileSync(pth.join(path, 'suite.js'))).toNot(beTrue);
+ });
+ });
});
- it('generates a test suite', function (){
-
- run(function (){
- footest.generateSuite(options);
+ describe('when the suite option is passed', function (){
+ before(function (){
+ options = { target: target, dir: path, suite: true };
});
- // FIXME: ugh... isFileSync is actually async. fsh sucks ass.
- waitFor(function (){
- expect(fs.isFileSync(pth.join(path, 'suite.js'))).to(beTrue);
+ it('generates a test suite', function (){
+ run(function (){
+ footest.generateSuite(options);
+ });
+
+ // FIXME: ugh... isFileSync is actually async. fsh sucks ass.
+ waitFor(function (){
+ expect(fs.isFileSync(pth.join(path, 'suite.js'))).to(beTrue);
+ });
});
});
});
- });
- }
+ })(targets[i]);
+ } // end of generated tests
});
}});
Please sign in to comment.
Something went wrong with that request. Please try again.