git ssb

0+

cel-desktop / ssb-pkg



Tree: 938b7ea4cfaa3cef6e1690b9ef3ea8bd7a0d2de1

Files: 938b7ea4cfaa3cef6e1690b9ef3ea8bd7a0d2de1 / test / test-77-compare-dicts-and-tests / main.js

1145 bytesRaw
1#!/usr/bin/env node
2
3'use strict';
4
5const fs = require('fs');
6const path = require('path');
7const assert = require('assert');
8
9let configs = fs.readdirSync('../../dictionary');
10configs = 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
17let tests = fs.readdirSync('../test-79-npm');
18tests = 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
24tests.push('etc'); // TODO who creates it?
25tests.push('steam-resources'); // absent in npm. installed via github
26
27configs.push('etc'); // TODO who creates it?
28configs.push('express-with-jade');
29configs.push('redis-with-hiredis');
30
31let absent = false;
32
33configs.some(function (config) {
34 if (tests.indexOf(config) < 0) {
35 console.log(config + ' is absent in tests');
36 absent = true;
37 }
38});
39
40tests.some(function (test) {
41 if (configs.indexOf(test) < 0) {
42 console.log(test + ' is absent in dictionary');
43 absent = true;
44 }
45});
46
47assert(!absent);
48

Built with git-ssb-web