forked from cnpm/bug-versions
-
Notifications
You must be signed in to change notification settings - Fork 0
/
test.js
35 lines (30 loc) · 1.02 KB
/
test.js
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
'use strict';
const assert = require('assert');
const bugVersions = require('.');
let pkgCount = 0;
let versionCount = 0;
for (const name in bugVersions) {
pkgCount++;
const versions = bugVersions[name];
assert(versions);
for (const version in versions) {
versionCount++;
const item = versions[version];
assert(item);
assert(item.version || item.dependencies);
if (item.version) {
assert(typeof item.version === 'string');
} else if (item.dependencies) {
assert(typeof item.dependencies === 'object');
assert(Object.keys(item.dependencies).length > 0);
}
assert(item.reason)
assert(typeof item.reason === 'string');
}
}
console.log('Total: %d bug pkgs and %d bug versions', pkgCount, versionCount);
console.log('');
const pkg = require('./package');
console.log('unsafe-node-versions: %s', JSON.stringify(pkg.config['unsafe-node-versions'], null, 2));
console.log('');
console.log('unsafe-alinode-versions: %s', JSON.stringify(pkg.config['unsafe-alinode-versions'], null, 2));