Skip to content

Commit a14b1b6

Browse files
authored
Update dev dependencies (#268)
* Update dev dependencies * touchFile can take a path, touch the right files, listen for the right message
1 parent 7030da7 commit a14b1b6

6 files changed

Lines changed: 15 additions & 14 deletions

File tree

package.json

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -41,16 +41,16 @@
4141
"semver": "^7.3.5"
4242
},
4343
"devDependencies": {
44-
"@types/node": "^14.14.37",
45-
"eslint": "^7.25.0",
44+
"@types/node": "^16.11.3",
45+
"eslint": "^8.0.1",
4646
"eslint-plugin-import": "^2.22.1",
47-
"husky": "^6.0.0",
48-
"lint-staged": "^10.5.4",
47+
"husky": "^7.0.4",
48+
"lint-staged": "^11.2.3",
4949
"prettier": "^2.2.1",
5050
"tap": "^15.0.2",
5151
"tap-xunit": "^2.4.1",
5252
"touch": "^3.1.0",
53-
"ts-node": "^9.1.1",
53+
"ts-node": "^10.3.1",
5454
"typescript": "^4.1.5"
5555
},
5656
"lint-staged": {

test/fixture/typescript/index.ts

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
import { createServer } from 'http';
22

3-
import * as message from '../message';
3+
import message from './message';
44

55
const server = createServer((req, res) => {
66
res.writeHead(200, { 'Content-Type': 'text/plain' });
@@ -9,8 +9,8 @@ const server = createServer((req, res) => {
99
});
1010

1111
server.once('listening', () => {
12-
const addressInfo = server.address();
13-
const address = typeof addressInfo === 'string' ?
12+
const addressInfo = server.address() || 'unknown';
13+
const address = typeof addressInfo == 'string' ?
1414
addressInfo : `${addressInfo.address}:${addressInfo.port}`;
1515

1616
console.log(`Server listening on ${address}`);

test/fixture/typescript/message.ts

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
export default 'Please touch message.ts now';

test/spawn/cli-require.js

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -4,8 +4,8 @@ const { spawn, touchFile } = require('../utils');
44

55
tap.test('Supports require from the command-line (ts-node/register)', t => {
66
spawn('--require=ts-node/register typescript/index.ts', out => {
7-
if (out.match(/touch message.js/)) {
8-
touchFile('message.js');
7+
if (out.match(/touch message.ts/)) {
8+
touchFile('typescript', 'message.ts');
99
return out2 => {
1010
if (out2.match(/Restarting/)) {
1111
t.match(out2, /\[INFO\] \d{2}:\d{2}:\d{2} Restarting/);

test/spawn/typescript.js

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -4,8 +4,8 @@ const { spawn, touchFile } = require('../utils');
44

55
tap.test('Uses ts-node/register for .ts files through config file (also the default)', t => {
66
spawn('typescript/index.ts', out => {
7-
if (out.match(/touch message.js/)) {
8-
touchFile('message.js');
7+
if (out.match(/touch message.ts/)) {
8+
touchFile('typescript', 'message.ts');
99
return out2 => {
1010
if (out2.match(/Restarting/)) {
1111
t.match(out2, /\[INFO\] \d{2}:\d{2}:\d{2} Restarting/);

test/utils.js

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -54,6 +54,6 @@ exports.spawn = (cmd, cb) => {
5454
// but most file systems only have second precision, so wait
5555
// one full second before touching.
5656

57-
exports.touchFile = filename => {
58-
setTimeout(() => touch(join(dir, filename)), 1000);
57+
exports.touchFile = (...filepath) => {
58+
setTimeout(() => touch(join(dir, ...filepath)), 1000);
5959
};

0 commit comments

Comments
 (0)