UNPKG

611 BJavaScriptView Raw
1'use strict';
2
3
4var Fs = require('fs');
5var Path = require('path');
6
7
8var ISSUES_DIR = Path.join(__dirname, 'issues');
9
10
11var re = /[.]js$/;
12var issues = {};
13Fs.readdirSync(ISSUES_DIR).forEach(function (f) {
14 var data;
15
16 if (!re.test(f)) {
17 // skip non-js files
18 return;
19 }
20
21 data = require(Path.join(ISSUES_DIR, f));
22
23 if (data.pending) {
24 issues[data.title] = 'pending';
25 return;
26 }
27
28 issues[data.title] = function () {
29 data.test();
30 if (!data.fixed) {
31 throw "Test passed, but it shouldn't!";
32 }
33 };
34});
35
36
37require('vows').describe('Issues').addBatch(issues).export(module);