Skip to content

Commit ab00e4a

Browse files
committed
f: chore: create package & add tooling
1 parent bf4d3c8 commit ab00e4a

File tree

1 file changed

+16
-16
lines changed

1 file changed

+16
-16
lines changed

tests/index.js

Lines changed: 16 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -1,24 +1,24 @@
1-
'use strict';
1+
"use strict";
22

3-
let ChildProcess = require('child_process');
4-
let Fs = require('node:fs/promises');
5-
let Path = require('node:path');
3+
let ChildProcess = require("child_process");
4+
let Fs = require("node:fs/promises");
5+
let Path = require("node:path");
66

77
async function main() {
8-
console.info('TAP version 13');
8+
console.info("TAP version 13");
99

1010
let dirents = await Fs.readdir(__dirname, { withFileTypes: true });
1111

1212
let failures = 0;
1313
let count = 0;
1414
for (let dirent of dirents) {
15-
if (dirent.name === 'index.js') {
15+
if (dirent.name === "index.js") {
1616
continue;
1717
}
1818

1919
count += 1;
2020
let direntPath = Path.join(__dirname, dirent.name);
21-
let relPath = Path.relative('.', direntPath);
21+
let relPath = Path.relative(".", direntPath);
2222

2323
let success = await handleEach(count, relPath);
2424
if (!success) {
@@ -45,7 +45,7 @@ async function main() {
4545
}
4646

4747
async function handleEach(count, relPath) {
48-
let success = await exec('node', [relPath])
48+
let success = await exec("node", [relPath])
4949
.then(function (result) {
5050
console.info(`ok ${count} - ${relPath}`);
5151
return true;
@@ -71,19 +71,19 @@ async function exec(exe, args) {
7171
let stdout = [];
7272
let stderr = [];
7373

74-
cmd.stdout.on('data', function (data) {
75-
stdout.push(data.toString('utf8'));
74+
cmd.stdout.on("data", function (data) {
75+
stdout.push(data.toString("utf8"));
7676
});
7777

78-
cmd.stderr.on('data', function (data) {
79-
stderr.push(data.toString('utf8'));
78+
cmd.stderr.on("data", function (data) {
79+
stderr.push(data.toString("utf8"));
8080
});
8181

82-
cmd.on('close', function (code) {
82+
cmd.on("close", function (code) {
8383
let result = {
8484
code: code,
85-
stdout: stdout.join(''),
86-
stderr: stderr.join(''),
85+
stdout: stdout.join(""),
86+
stderr: stderr.join(""),
8787
};
8888

8989
if (!code) {
@@ -103,7 +103,7 @@ main()
103103
process.exit(0);
104104
})
105105
.catch(function (err) {
106-
console.error('Fail:');
106+
console.error("Fail:");
107107
console.error(err.stack || err);
108108
process.exit(1);
109109
});

0 commit comments

Comments
 (0)