Skip to content

Commit ee2adf3

Browse files
committed
Test: Update failing-versions.js
Most older QUnit versions are passing now, yay.
1 parent 3708273 commit ee2adf3

File tree

2 files changed

+103
-32
lines changed

2 files changed

+103
-32
lines changed

test/versions/failing-versions.js

Lines changed: 87 additions & 24 deletions
Original file line numberDiff line numberDiff line change
@@ -1,29 +1,92 @@
11
/**
2-
* Here is a brief list with the known issues.
3-
*
4-
* Jasmine 2.3.0: there is a bug that makes Jasmine to exit and kill the
5-
* process. This is solved in the 2.3.1 version. @see
6-
* https://github.com/jasmine/jasmine-npm/blob/master/release_notes/2.3.1.md
7-
*
8-
* Jasmine 2.5.0: it is the same bug as in the 2.3.0 version. @see
9-
* https://github.com/jasmine/jasmine-npm/issues/88
10-
*
11-
* Mocha 2.5.0: is not working because of a missing dependency, this is Mocha's
12-
* fault @see
13-
* https://github.com/mochajs/mocha/blob/master/CHANGELOG.md#251--2016-05-23.
2+
* Known issues.
143
*/
154

165
module.exports = {
17-
qunitjs: ['1.9.0', '1.10.0', '1.11.0', '1.12.0-pre', '1.12.0', '1.13.0',
18-
'1.14.0', '1.15.0', '1.16.0', '1.17.0', '1.17.1', '1.18.0', '1.19.0'],
19-
jasmine: ['2.3.0', '2.5.0'],
20-
mocha: ['0.3.0', '0.3.1', '0.3.2', '0.3.3', '0.3.4', '0.3.6', '0.4.0',
21-
'0.5.0', '0.6.0', '0.7.0', '0.7.1', '0.8.0', '0.9.0', '0.10.0', '0.10.1',
22-
'0.10.2', '0.11.0', '0.12.0', '0.12.1', '0.13.0', '0.14.0', '0.14.1',
23-
'1.0.0', '1.0.1', '1.0.2', '1.0.3', '1.1.0', '1.2.0', '1.2.1', '1.2.2',
24-
'1.3.0', '1.3.1', '1.3.2', '1.4.0', '1.4.1', '1.4.2', '1.4.3', '1.5.0',
25-
'1.6.0', '1.7.0', '1.7.1', '1.7.2', '1.7.3', '1.7.4', '1.8.0', '1.8.1',
26-
'1.8.2', '1.9.0', '1.10.0', '1.11.0', '1.12.0', '1.12.1', '1.13.0',
27-
'1.14.0', '1.15.0', '1.15.1', '1.16.0', '1.16.1', '1.16.2', '1.17.0',
28-
'1.17.1', '2.1.0', '2.5.0']
6+
// The package name 'qunitjs' is deprecated in favour of 'qunit'.
7+
// It provides [email protected] until [email protected].
8+
qunitjs: [
9+
'1.11.0',
10+
'1.12.0-pre',
11+
'1.12.0',
12+
'1.13.0'
13+
],
14+
jasmine: [
15+
// Jasmine 2.3.0: there is a bug that makes Jasmine exit and kill the process.
16+
// https://github.com/jasmine/jasmine-npm/blob/v2.99.0/release_notes/2.3.1.md
17+
// Fixed in [email protected].
18+
'2.3.0',
19+
// Jasmine 2.5.0: the same bug as in the 2.3.0 version.
20+
// https://github.com/jasmine/jasmine-npm/issues/88
21+
// Re-fixed in [email protected].
22+
'2.5.0'
23+
],
24+
mocha: [
25+
'0.3.0',
26+
'0.3.1',
27+
'0.3.2',
28+
'0.3.3',
29+
'0.3.4',
30+
'0.3.6',
31+
'0.4.0',
32+
'0.5.0',
33+
'0.6.0',
34+
'0.7.0',
35+
'0.7.1',
36+
'0.8.0',
37+
'0.9.0',
38+
'0.10.0',
39+
'0.10.1',
40+
'0.10.2',
41+
'0.11.0',
42+
'0.12.0',
43+
'0.12.1',
44+
'0.13.0',
45+
'0.14.0',
46+
'0.14.1',
47+
'1.0.0',
48+
'1.0.1',
49+
'1.0.2',
50+
'1.0.3',
51+
'1.1.0',
52+
'1.2.0',
53+
'1.2.1',
54+
'1.2.2',
55+
'1.3.0',
56+
'1.3.1',
57+
'1.3.2',
58+
'1.4.0',
59+
'1.4.1',
60+
'1.4.2',
61+
'1.4.3',
62+
'1.5.0',
63+
'1.6.0',
64+
'1.7.0',
65+
'1.7.1',
66+
'1.7.2',
67+
'1.7.3',
68+
'1.7.4',
69+
'1.8.0',
70+
'1.8.1',
71+
'1.8.2',
72+
'1.9.0',
73+
'1.10.0',
74+
'1.11.0',
75+
'1.12.0',
76+
'1.12.1',
77+
'1.13.0',
78+
'1.14.0',
79+
'1.15.0',
80+
'1.15.1',
81+
'1.16.0',
82+
'1.16.1',
83+
'1.16.2',
84+
'1.17.0',
85+
'1.17.1',
86+
'2.1.0',
87+
// Mocha 2.5.0: is not working because of a missing dependency, this is Mocha's
88+
// fault @see
89+
// https://github.com/mochajs/mocha/blob/master/CHANGELOG.md#251--2016-05-23.
90+
'2.5.0'
91+
]
2992
};

test/versions/versions-reporting.js

Lines changed: 16 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -1,29 +1,36 @@
11
const childProcess = require('child_process');
2+
const fs = require('fs');
23
const chalk = require('chalk');
3-
const frameworks = ['QUnitJS', 'Jasmine', 'Mocha'];
4+
const packages = [
5+
'qunitjs',
6+
'jasmine',
7+
'mocha'
8+
];
49

510
console.log();
611

12+
const originalLock = fs.readFileSync('package-lock.json', 'utf8');
13+
714
/**
815
* Takes each version of each framework available on npm and runs the tests
916
* against it, making in the end a summary of versions which are working with
1017
* the js-reporters adapters and which don't.
1118
*/
12-
frameworks.forEach(function (framework) {
13-
let command = 'npm view ' + framework.toLowerCase() + ' versions';
19+
packages.forEach(function (pgk) {
20+
let command = 'npm view ' + pgk + ' versions';
1421
const output = childProcess.execSync(command).toString()
1522
.replace(/[[]|]|'| |\n/g, '');
1623
const versions = output.split(',');
1724
const workingVersions = [];
1825
const notWorkingVersions = [];
1926

20-
console.log(chalk.underline.bold.green(framework));
27+
console.log(chalk.underline.bold.green(pgk));
2128
console.log();
2229

2330
versions.forEach(function (version) {
2431
console.log(chalk.dim('Testing version: ' + version));
2532

26-
command = 'npm install ' + framework.toLowerCase() + '@' + version;
33+
command = 'npm install ' + pgk + '@' + version;
2734
childProcess.execSync(command, {
2835
stdio: ['ignore', 'ignore', 'ignore']
2936
});
@@ -37,15 +44,16 @@ frameworks.forEach(function (framework) {
3744
}
3845
});
3946

40-
module.exports[framework.toLowerCase()] = notWorkingVersions;
47+
module.exports[pgk] = notWorkingVersions;
4148

4249
console.log();
4350
console.log(chalk.green('Working: ' + workingVersions.join(', ') + ';'));
4451
console.log(chalk.red('Not working: ' + notWorkingVersions.join(', ') + ';'));
4552
console.log();
4653
});
4754

48-
// Install the versions from package.json.
49-
childProcess.execSync('npm install', {
55+
// Restore package-lock.json and re-install based on that.
56+
fs.writeFileSync('package-lock.json', originalLock);
57+
childProcess.execSync('npm ci', {
5058
stdio: ['ignore', 'ignore', 'ignore']
5159
});

0 commit comments

Comments
 (0)