Skip to content

Commit 1d875d1

Browse files
committed
chore: lint
1 parent 1d75fd1 commit 1d875d1

File tree

5 files changed

+12
-8
lines changed

5 files changed

+12
-8
lines changed

server/operate.js

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -70,6 +70,13 @@ function operate(type, id, socket, from, to, files) {
7070
socket.emit(`${id}#error`, msg, name);
7171
});
7272

73+
operator.on('abort', () => {
74+
socket.emit(`${id}#end`);
75+
socket.removeListener(`${id}#pause`, onPause);
76+
socket.removeListener(`${id}#continue`, onContinue);
77+
socket.removeListener(`${id}#abort`, onAbort);
78+
});
79+
7380
operator.on('end', () => {
7481
socket.emit(`${id}#end`);
7582
socket.removeListener(`${id}#pause`, onPause);

test/client/fileop.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -285,7 +285,7 @@ test('client: disconnect', async (t) => {
285285
t.equal(e, 'ENOENT: /hello/abc');
286286
t.pass('should disconnect');
287287
t.end();
288-
});
288+
}, {checkAssertionsCount: false});
289289

290290
test('client: auth: reject', async (t) => {
291291
const auth = (accept, reject) => reject;

test/server/index.js

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -39,7 +39,6 @@ test('fileop: static: dev', async (t) => {
3939
const file = fs.readFileSync(name, 'utf8');
4040

4141
done();
42-
/* eslint require-atomic-updates: 0 */
4342
process.env.NODE_ENV = NODE_ENV;
4443
clearFileop();
4544
require(connectPath);
@@ -48,7 +47,7 @@ test('fileop: static: dev', async (t) => {
4847
t.end();
4948
});
5049

51-
test('fileop: static', async (t) => {
50+
test('fileop: static: 404', async (t) => {
5251
const {url, done} = await connect();
5352
const {status} = await fetch(`${url}/hello.txt`);
5453

test/server/is-root-win32.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@
33
const test = require('supertape');
44
const isRootPath = '../../server/is-root-win32';
55

6-
test('isRootWin32', (t) => {
6+
test('fileop: isRootWin32', (t) => {
77
const path = '/';
88
const root = '/';
99

test/server/zip.js

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -170,10 +170,8 @@ test('operate: zip: abort', async (t) => {
170170
const emit = socket.emit.bind(socket);
171171

172172
await Promise.all([
173-
wait(emit, `${id}#start`),
174-
once(socket, `${id}#error`),
175-
176-
wait(emit, `${id}#abort`),
173+
wait(500, emit, `${id}#start`),
174+
wait(1000, emit, `${id}#abort`),
177175
once(socket, `${id}#end`),
178176
]);
179177

0 commit comments

Comments
 (0)