Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP

Loading…

Add instructive error message to importSuites that could help new users. #262

Merged
merged 1 commit into from

3 participants

@hangtwenty

Add instructive error message to importSuites that could help new users.

Fixes issue #261.

@indexzero
Owner

Cool! Will check this out this week.

@indexzero
Owner

:+1: will go into 0.8.x

@indexzero indexzero added the v0.8.x label
@indexzero indexzero merged commit 068e027 into vowsjs:master
@Tug

Could we update the npm package with this fix?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Commits on Jan 21, 2013
  1. @hangtwenty
This page is out of date. Refresh to see the latest.
Showing with 14 additions and 1 deletion.
  1. +14 −1 bin/vows
View
15 bin/vows
@@ -571,7 +571,20 @@ function importSuites(files) {
//f = path.join(process.cwd(), path.relative(process.cwd(),f));
var obj = require(f);
return suites.concat(Object.keys(obj).map(function (s) {
- obj[s]._filename = cwdname(f);
+ try {
+ obj[s]._filename = cwdname(f);
+ } catch (e) {
+ if (e instanceof TypeError && typeof(obj[s]) === 'undefined') {
+ abort("runner",
+ "Caught a TypeError while trying to import " +
+ "suites: a suite is undefined." +
+ "Check your exports; are you doing something like " +
+ "exports.suite = vows.describe('foo')." +
+ "addBatch({}).run()? If so, remove '.run()'");
+ } else {
+ throw e;
+ }
+ }
return obj[s];
}));
}, [])
Something went wrong with that request. Please try again.