Skip to content

Commit 5a7cadc

Browse files
committed
chore(dev-dep): drop nodeunit for node:test
1 parent 5a20cef commit 5a7cadc

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

49 files changed

+3354
-6455
lines changed

.gitignore

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -20,3 +20,4 @@ node_modules/*
2020
npm-debug.log
2121
coverage
2222
.nyc_output
23+
lcov.info

package-lock.json

Lines changed: 1 addition & 2960 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

package.json

Lines changed: 2 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -14,26 +14,11 @@
1414
"uuid": "^7.0.3"
1515
},
1616
"devDependencies": {
17-
"nodeunit": "^0.11.3",
18-
"nyc": "^15.0.0",
1917
"pegjs": "^0.10.0"
2018
},
2119
"scripts": {
2220
"pegjs": "node_modules/.bin/pegjs lib/parser/pbxproj.pegjs",
23-
"test": "npm run cover",
24-
"test:unit": "nodeunit test/parser test",
25-
"cover": "nyc npm run test:unit"
21+
"test": "node --test --experimental-test-coverage --test-reporter=spec --test-reporter=lcov --test-reporter-destination=stdout --test-reporter-destination=lcov.info"
2622
},
27-
"license": "Apache-2.0",
28-
"nyc": {
29-
"all": true,
30-
"exclude": [
31-
"coverage/",
32-
"test/"
33-
],
34-
"reporter": [
35-
"lcov",
36-
"text"
37-
]
38-
}
23+
"license": "Apache-2.0"
3924
}

test/BuildSettings.js

Lines changed: 14 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -16,8 +16,10 @@
1616
specific language governing permissions and limitations
1717
under the License.
1818
*/
19+
const { describe, it, beforeEach } = require('node:test');
20+
const assert = require('node:assert');
1921

20-
var fullProject = require('./fixtures/full-project')
22+
var fullProject = require('./fixtures/full-project'),
2123
fullProjectStr = JSON.stringify(fullProject),
2224
pbx = require('../lib/pbxProject'),
2325
pbxFile = require('../lib/pbxFile'),
@@ -27,34 +29,31 @@ function cleanHash() {
2729
return JSON.parse(fullProjectStr);
2830
}
2931

30-
exports.setUp = function (callback) {
31-
proj.hash = cleanHash();
32-
callback();
33-
}
3432

3533
var PRODUCT_NAME = '"KitchenSinktablet"';
3634

37-
exports.addAndRemoveToFromBuildSettings = {
38-
'add should add the build setting to each configuration section':function(test) {
35+
describe('addAndRemoveToFromBuildSettings', () => {
36+
beforeEach(() => {
37+
proj.hash = cleanHash();
38+
});
39+
it('add should add the build setting to each configuration section', () => {
3940
var buildSetting = 'some/buildSetting';
4041
var value = 'some/buildSetting';
4142
proj.addToBuildSettings(buildSetting, value);
4243
var config = proj.pbxXCBuildConfigurationSection();
4344
for (var ref in config) {
4445
if (ref.indexOf('_comment') > -1 || config[ref].buildSettings.PRODUCT_NAME != PRODUCT_NAME) continue;
45-
test.ok(config[ref].buildSettings[buildSetting] === value);
46+
assert.ok(config[ref].buildSettings[buildSetting] === value);
4647
}
47-
test.done();
48-
},
49-
'remove should remove from the build settings in each configuration section':function(test) {
48+
});
49+
it('remove should remove from the build settings in each configuration section', () => {
5050
var buildSetting = 'some/buildSetting';
5151
proj.addToBuildSettings(buildSetting, 'some/buildSetting');
5252
proj.removeFromBuildSettings(buildSetting);
5353
var config = proj.pbxXCBuildConfigurationSection();
5454
for (var ref in config) {
5555
if (ref.indexOf('_comment') > -1 || config[ref].buildSettings.PRODUCT_NAME != PRODUCT_NAME) continue;
56-
test.ok(!config[ref].buildSettings.hasOwnProperty(buildSetting));
56+
assert.ok(!config[ref].buildSettings.hasOwnProperty(buildSetting));
5757
}
58-
test.done();
59-
}
60-
}
58+
});
59+
});

test/FrameworkSearchPaths.js

Lines changed: 16 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -16,8 +16,10 @@
1616
specific language governing permissions and limitations
1717
under the License.
1818
*/
19+
const { describe, it, beforeEach } = require('node:test');
20+
const assert = require('node:assert');
1921

20-
var fullProject = require('./fixtures/full-project')
22+
var fullProject = require('./fixtures/full-project'),
2123
fullProjectStr = JSON.stringify(fullProject),
2224
pbx = require('../lib/pbxProject'),
2325
pbxFile = require('../lib/pbxFile'),
@@ -32,34 +34,32 @@ function cleanHash() {
3234
return JSON.parse(fullProjectStr);
3335
}
3436

35-
exports.setUp = function (callback) {
36-
proj.hash = cleanHash();
37-
callback();
38-
}
3937

4038
var PRODUCT_NAME = '"KitchenSinktablet"';
4139

42-
exports.addAndRemoveToFromFrameworkSearchPaths = {
43-
'add should add the path to each configuration section':function(test) {
40+
describe('addAndRemoveToFromFrameworkSearchPaths', () => {
41+
beforeEach(() => {
42+
proj.hash = cleanHash();
43+
});
44+
45+
it('add should add the path to each configuration section', () => {
4446
proj.addToFrameworkSearchPaths(pbxFile);
4547
var config = proj.pbxXCBuildConfigurationSection();
4648
for (var ref in config) {
4749
if (ref.indexOf('_comment') > -1 || config[ref].buildSettings.PRODUCT_NAME != PRODUCT_NAME) continue;
4850
var lib = config[ref].buildSettings.FRAMEWORK_SEARCH_PATHS;
49-
test.ok(lib[1].indexOf('some/path') > -1);
51+
assert.ok(lib[1].indexOf('some/path') > -1);
5052
}
51-
test.done();
52-
},
53-
'remove should remove from the path to each configuration section':function(test) {
53+
});
54+
it('remove should remove from the path to each configuration section', () => {
5455
proj.addToFrameworkSearchPaths(pbxFile);
5556
proj.removeFromFrameworkSearchPaths(pbxFile);
5657
var config = proj.pbxXCBuildConfigurationSection();
5758
for (var ref in config) {
5859
if (ref.indexOf('_comment') > -1 || config[ref].buildSettings.PRODUCT_NAME != PRODUCT_NAME) continue;
5960
var lib = config[ref].buildSettings.FRAMEWORK_SEARCH_PATHS;
60-
test.ok(lib.length === 1);
61-
test.ok(lib[0].indexOf('some/path') == -1);
61+
assert.ok(lib.length === 1);
62+
assert.ok(lib[0].indexOf('some/path') == -1);
6263
}
63-
test.done();
64-
}
65-
}
64+
});
65+
});

test/HeaderSearchPaths.js

Lines changed: 19 additions & 20 deletions
Original file line numberDiff line numberDiff line change
@@ -16,8 +16,10 @@
1616
specific language governing permissions and limitations
1717
under the License.
1818
*/
19+
const { describe, it, beforeEach } = require('node:test');
20+
const assert = require('node:assert');
1921

20-
var fullProject = require('./fixtures/full-project')
22+
var fullProject = require('./fixtures/full-project'),
2123
fullProjectStr = JSON.stringify(fullProject),
2224
pbx = require('../lib/pbxProject'),
2325
pbxFile = require('../lib/pbxFile'),
@@ -27,38 +29,36 @@ function cleanHash() {
2729
return JSON.parse(fullProjectStr);
2830
}
2931

30-
exports.setUp = function (callback) {
31-
proj.hash = cleanHash();
32-
callback();
33-
}
3432

3533
var PRODUCT_NAME = '"KitchenSinktablet"';
3634

37-
exports.addAndRemoveToFromHeaderSearchPaths = {
38-
'add should add the path to each configuration section':function(test) {
35+
describe('addAndRemoveToFromHeaderSearchPaths', () => {
36+
beforeEach(() => {
37+
proj.hash = cleanHash();
38+
});
39+
40+
it('add should add the path to each configuration section', () => {
3941
proj.addToHeaderSearchPaths({
4042
path:'some/path/include'
4143
});
4244
var config = proj.pbxXCBuildConfigurationSection();
4345
for (var ref in config) {
4446
if (ref.indexOf('_comment') > -1 || config[ref].buildSettings.PRODUCT_NAME != PRODUCT_NAME) continue;
4547
var lib = config[ref].buildSettings.HEADER_SEARCH_PATHS;
46-
test.ok(lib[1].indexOf('$(SRCROOT)/KitchenSinktablet/some/path') > -1);
48+
assert.ok(lib[1].indexOf('$(SRCROOT)/KitchenSinktablet/some/path') > -1);
4749
}
48-
test.done();
49-
},
50-
'add should not mangle string arguments and add to each config section':function(test) {
50+
});
51+
it('add should not mangle string arguments and add to each config section', () => {
5152
var includePath = '../../some/path';
5253
proj.addToHeaderSearchPaths(includePath);
5354
var config = proj.pbxXCBuildConfigurationSection();
5455
for (var ref in config) {
5556
if (ref.indexOf('_comment') > -1 || config[ref].buildSettings.PRODUCT_NAME != PRODUCT_NAME) continue;
5657
var lib = config[ref].buildSettings.HEADER_SEARCH_PATHS;
57-
test.ok(lib[1].indexOf(includePath) > -1);
58+
assert.ok(lib[1].indexOf(includePath) > -1);
5859
}
59-
test.done();
60-
},
61-
'remove should remove from the path to each configuration section':function(test) {
60+
});
61+
it('remove should remove from the path to each configuration section', () => {
6262
var libPath = 'some/path/include';
6363
proj.addToHeaderSearchPaths({
6464
path:libPath
@@ -70,9 +70,8 @@ exports.addAndRemoveToFromHeaderSearchPaths = {
7070
for (var ref in config) {
7171
if (ref.indexOf('_comment') > -1 || config[ref].buildSettings.PRODUCT_NAME != PRODUCT_NAME) continue;
7272
var lib = config[ref].buildSettings.HEADER_SEARCH_PATHS;
73-
test.ok(lib.length === 1);
74-
test.ok(lib[0].indexOf('$(SRCROOT)/KitchenSinktablet/some/path/include') == -1);
73+
assert.ok(lib.length === 1);
74+
assert.ok(lib[0].indexOf('$(SRCROOT)/KitchenSinktablet/some/path/include') == -1);
7575
}
76-
test.done();
77-
}
78-
}
76+
});
77+
});

test/LibrarySearchPaths.js

Lines changed: 19 additions & 20 deletions
Original file line numberDiff line numberDiff line change
@@ -16,8 +16,10 @@
1616
specific language governing permissions and limitations
1717
under the License.
1818
*/
19+
const { describe, it, beforeEach } = require('node:test');
20+
const assert = require('node:assert');
1921

20-
var fullProject = require('./fixtures/full-project')
22+
var fullProject = require('./fixtures/full-project'),
2123
fullProjectStr = JSON.stringify(fullProject),
2224
pbx = require('../lib/pbxProject'),
2325
pbxFile = require('../lib/pbxFile'),
@@ -27,38 +29,36 @@ function cleanHash() {
2729
return JSON.parse(fullProjectStr);
2830
}
2931

30-
exports.setUp = function (callback) {
31-
proj.hash = cleanHash();
32-
callback();
33-
}
3432

3533
var PRODUCT_NAME = '"KitchenSinktablet"';
3634

37-
exports.addAndRemoveToFromLibrarySearchPaths = {
38-
'add should add the path to each configuration section':function(test) {
35+
describe('addAndRemoveToFromLibrarySearchPaths', () => {
36+
beforeEach(() => {
37+
proj.hash = cleanHash();
38+
});
39+
40+
it('add should add the path to each configuration section', () => {
3941
proj.addToLibrarySearchPaths({
4042
path:'some/path/poop.a'
4143
});
4244
var config = proj.pbxXCBuildConfigurationSection();
4345
for (var ref in config) {
4446
if (ref.indexOf('_comment') > -1 || config[ref].buildSettings.PRODUCT_NAME != PRODUCT_NAME) continue;
4547
var lib = config[ref].buildSettings.LIBRARY_SEARCH_PATHS;
46-
test.ok(lib[1].indexOf('$(SRCROOT)/KitchenSinktablet/some/path') > -1);
48+
assert.ok(lib[1].indexOf('$(SRCROOT)/KitchenSinktablet/some/path') > -1);
4749
}
48-
test.done();
49-
},
50-
'add should not mangle string arguments and add to each config section':function(test) {
50+
});
51+
it('add should not mangle string arguments and add to each config section', () => {
5152
var libPath = '../../some/path';
5253
proj.addToLibrarySearchPaths(libPath);
5354
var config = proj.pbxXCBuildConfigurationSection();
5455
for (var ref in config) {
5556
if (ref.indexOf('_comment') > -1 || config[ref].buildSettings.PRODUCT_NAME != PRODUCT_NAME) continue;
5657
var lib = config[ref].buildSettings.LIBRARY_SEARCH_PATHS;
57-
test.ok(lib[1].indexOf(libPath) > -1);
58+
assert.ok(lib[1].indexOf(libPath) > -1);
5859
}
59-
test.done();
60-
},
61-
'remove should remove from the path to each configuration section':function(test) {
60+
});
61+
it('remove should remove from the path to each configuration section', () => {
6262
var libPath = 'some/path/poop.a';
6363
proj.addToLibrarySearchPaths({
6464
path:libPath
@@ -70,9 +70,8 @@ exports.addAndRemoveToFromLibrarySearchPaths = {
7070
for (var ref in config) {
7171
if (ref.indexOf('_comment') > -1 || config[ref].buildSettings.PRODUCT_NAME != PRODUCT_NAME) continue;
7272
var lib = config[ref].buildSettings.LIBRARY_SEARCH_PATHS;
73-
test.ok(lib.length === 1);
74-
test.ok(lib[0].indexOf('$(SRCROOT)/KitchenSinktablet/some/path') == -1);
73+
assert.ok(lib.length === 1);
74+
assert.ok(lib[0].indexOf('$(SRCROOT)/KitchenSinktablet/some/path') == -1);
7575
}
76-
test.done();
77-
}
78-
}
76+
});
77+
});

test/OtherLinkerFlags.js

Lines changed: 16 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -16,8 +16,10 @@
1616
specific language governing permissions and limitations
1717
under the License.
1818
*/
19+
const { describe, it, beforeEach } = require('node:test');
20+
const assert = require('node:assert');
1921

20-
var fullProject = require('./fixtures/full-project')
22+
var fullProject = require('./fixtures/full-project'),
2123
fullProjectStr = JSON.stringify(fullProject),
2224
pbx = require('../lib/pbxProject'),
2325
pbxFile = require('../lib/pbxFile'),
@@ -27,36 +29,34 @@ function cleanHash() {
2729
return JSON.parse(fullProjectStr);
2830
}
2931

30-
exports.setUp = function (callback) {
31-
proj.hash = cleanHash();
32-
callback();
33-
}
3432

3533
var PRODUCT_NAME = '"KitchenSinktablet"';
3634

37-
exports.addAndRemoveToFromOtherLinkerFlags = {
38-
'add should add the flag to each configuration section':function(test) {
35+
describe('addAndRemoveToFromOtherLinkerFlags', () => {
36+
beforeEach(() => {
37+
proj.hash = cleanHash();
38+
});
39+
40+
it('add should add the flag to each configuration section', () => {
3941
var flag = 'some/flag';
4042
proj.addToOtherLinkerFlags(flag);
4143
var config = proj.pbxXCBuildConfigurationSection();
4244
for (var ref in config) {
4345
if (ref.indexOf('_comment') > -1 || config[ref].buildSettings.PRODUCT_NAME != PRODUCT_NAME) continue;
4446
var lib = config[ref].buildSettings.OTHER_LDFLAGS;
45-
test.ok(lib[1].indexOf(flag) > -1);
47+
assert.ok(lib[1].indexOf(flag) > -1);
4648
}
47-
test.done();
48-
},
49-
'remove should remove from the path to each configuration section':function(test) {
49+
});
50+
it('remove should remove from the path to each configuration section', () => {
5051
var flag = 'some/flag';
5152
proj.addToOtherLinkerFlags(flag);
5253
proj.removeFromOtherLinkerFlags(flag);
5354
var config = proj.pbxXCBuildConfigurationSection();
5455
for (var ref in config) {
5556
if (ref.indexOf('_comment') > -1 || config[ref].buildSettings.PRODUCT_NAME != PRODUCT_NAME) continue;
5657
var lib = config[ref].buildSettings.OTHER_LDFLAGS;
57-
test.ok(lib.length === 1);
58-
test.ok(lib[0].indexOf(flag) == -1);
58+
assert.ok(lib.length === 1);
59+
assert.ok(lib[0].indexOf(flag) == -1);
5960
}
60-
test.done();
61-
}
62-
}
61+
});
62+
});

0 commit comments

Comments
 (0)