Files: e9d9dec1d00ff365112ca0f981bbda15e3682528 / test / test-77-compare-dicts-and-tests / main.js
1145 bytesRaw
1 | |
2 | |
3 | 'use strict'; |
4 | |
5 | const fs = require('fs'); |
6 | const path = require('path'); |
7 | const assert = require('assert'); |
8 | |
9 | let configs = fs.readdirSync('../../dictionary'); |
10 | configs = configs.filter(function (config) { |
11 | return config !== '.eslintrc.json'; |
12 | }).map(function (config) { |
13 | assert.equal(config.slice(-3), '.js'); |
14 | return config.slice(0, -3); |
15 | }); |
16 | |
17 | let tests = fs.readdirSync('../test-79-npm'); |
18 | tests = tests.filter(function (test) { |
19 | if (test === '_isolator') return false; |
20 | const full = path.join('../test-79-npm', test); |
21 | return fs.statSync(full).isDirectory(); |
22 | }); |
23 | |
24 | tests.push('etc'); // TODO who creates it? |
25 | tests.push('steam-resources'); // absent in npm. installed via github |
26 | |
27 | configs.push('etc'); // TODO who creates it? |
28 | configs.push('express-with-jade'); |
29 | configs.push('redis-with-hiredis'); |
30 | |
31 | let absent = false; |
32 | |
33 | configs.some(function (config) { |
34 | if (tests.indexOf(config) < 0) { |
35 | console.log(config + ' is absent in tests'); |
36 | absent = true; |
37 | } |
38 | }); |
39 | |
40 | tests.some(function (test) { |
41 | if (configs.indexOf(test) < 0) { |
42 | console.log(test + ' is absent in dictionary'); |
43 | absent = true; |
44 | } |
45 | }); |
46 | |
47 | assert(!absent); |
48 |
Built with git-ssb-web