1 | 'use strict';
|
2 |
|
3 |
|
4 | var Fs = require('fs');
|
5 | var Path = require('path');
|
6 |
|
7 |
|
8 | var ISSUES_DIR = Path.join(__dirname, 'issues');
|
9 |
|
10 |
|
11 | var re = /[.]js$/;
|
12 | var issues = {};
|
13 | Fs.readdirSync(ISSUES_DIR).forEach(function (f) {
|
14 | var data;
|
15 |
|
16 | if (!re.test(f)) {
|
17 |
|
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 |
|
37 | require('vows').describe('Issues').addBatch(issues).export(module);
|