Skip to content

Commit

Permalink
add test first
Browse files Browse the repository at this point in the history
  • Loading branch information
jackyzha0 committed Oct 24, 2024
1 parent 40b2568 commit 3c2c102
Showing 1 changed file with 27 additions and 0 deletions.
27 changes: 27 additions & 0 deletions tests/index.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -325,6 +325,33 @@ describe(
}),
);

test('doesnt miss large output from fast commands',
{ repeats: 10 },
() =>
new Promise<void>((done) => {
const payload = `hello`.repeat(4096);
let buffer = Buffer.from('');
const pty = new Pty({
command: '/bin/sh',
args: [
'-c',
`echo ${payload}`,
],
onExit: (err, exitCode) => {
expect(err).toBeNull();
expect(exitCode).toBe(0);
expect(buffer.toString().length).toBe(payload.length);

Check failure on line 343 in tests/index.test.ts

View workflow job for this annotation

GitHub Actions / Build and test on x86_64-apple-darwin

Unhandled error

AssertionError: expected 20482 to be 20480 // Object.is equality - Expected + Received - 20480 + 20482 ❯ onExit tests/index.test.ts:343:48 ❯ wrapper.ts:89:9 This error originated in "tests/index.test.ts" test file. It doesn't mean the error was thrown inside the file itself, but while it was running. The latest test that might've caused the error is "doesnt miss large output from fast commands". It might mean one of the following: - The error was thrown, while Vitest was running this test. - If the error occurred after the test had been completed, this was the last documented test before it was thrown.

Check failure on line 343 in tests/index.test.ts

View workflow job for this annotation

GitHub Actions / Build and test on x86_64-apple-darwin

Unhandled error

AssertionError: expected 20482 to be 20480 // Object.is equality - Expected + Received - 20480 + 20482 ❯ onExit tests/index.test.ts:343:48 ❯ wrapper.ts:89:9 This error originated in "tests/index.test.ts" test file. It doesn't mean the error was thrown inside the file itself, but while it was running. The latest test that might've caused the error is "doesnt miss large output from fast commands". It might mean one of the following: - The error was thrown, while Vitest was running this test. - If the error occurred after the test had been completed, this was the last documented test before it was thrown.

Check failure on line 343 in tests/index.test.ts

View workflow job for this annotation

GitHub Actions / Build and test on x86_64-apple-darwin

Unhandled error

AssertionError: expected 20482 to be 20480 // Object.is equality - Expected + Received - 20480 + 20482 ❯ onExit tests/index.test.ts:343:48 ❯ wrapper.ts:89:9 This error originated in "tests/index.test.ts" test file. It doesn't mean the error was thrown inside the file itself, but while it was running. The latest test that might've caused the error is "doesnt miss large output from fast commands". It might mean one of the following: - The error was thrown, while Vitest was running this test. - If the error occurred after the test had been completed, this was the last documented test before it was thrown.

Check failure on line 343 in tests/index.test.ts

View workflow job for this annotation

GitHub Actions / Build and test on x86_64-apple-darwin

Unhandled error

AssertionError: expected 20482 to be 20480 // Object.is equality - Expected + Received - 20480 + 20482 ❯ onExit tests/index.test.ts:343:48 ❯ wrapper.ts:89:9 This error originated in "tests/index.test.ts" test file. It doesn't mean the error was thrown inside the file itself, but while it was running. The latest test that might've caused the error is "doesnt miss large output from fast commands". It might mean one of the following: - The error was thrown, while Vitest was running this test. - If the error occurred after the test had been completed, this was the last documented test before it was thrown.

Check failure on line 343 in tests/index.test.ts

View workflow job for this annotation

GitHub Actions / Build and test on x86_64-apple-darwin

Unhandled error

AssertionError: expected 20482 to be 20480 // Object.is equality - Expected + Received - 20480 + 20482 ❯ onExit tests/index.test.ts:343:48 ❯ wrapper.ts:89:9 This error originated in "tests/index.test.ts" test file. It doesn't mean the error was thrown inside the file itself, but while it was running. The latest test that might've caused the error is "doesnt miss large output from fast commands". It might mean one of the following: - The error was thrown, while Vitest was running this test. - If the error occurred after the test had been completed, this was the last documented test before it was thrown.

Check failure on line 343 in tests/index.test.ts

View workflow job for this annotation

GitHub Actions / Build and test on x86_64-apple-darwin

Unhandled error

AssertionError: expected 20482 to be 20480 // Object.is equality - Expected + Received - 20480 + 20482 ❯ onExit tests/index.test.ts:343:48 ❯ wrapper.ts:89:9 This error originated in "tests/index.test.ts" test file. It doesn't mean the error was thrown inside the file itself, but while it was running. The latest test that might've caused the error is "doesnt miss large output from fast commands". It might mean one of the following: - The error was thrown, while Vitest was running this test. - If the error occurred after the test had been completed, this was the last documented test before it was thrown.

Check failure on line 343 in tests/index.test.ts

View workflow job for this annotation

GitHub Actions / Build and test on x86_64-apple-darwin

Unhandled error

AssertionError: expected 20482 to be 20480 // Object.is equality - Expected + Received - 20480 + 20482 ❯ onExit tests/index.test.ts:343:48 ❯ wrapper.ts:89:9 This error originated in "tests/index.test.ts" test file. It doesn't mean the error was thrown inside the file itself, but while it was running. The latest test that might've caused the error is "doesnt miss large output from fast commands". It might mean one of the following: - The error was thrown, while Vitest was running this test. - If the error occurred after the test had been completed, this was the last documented test before it was thrown.

Check failure on line 343 in tests/index.test.ts

View workflow job for this annotation

GitHub Actions / Build and test on x86_64-apple-darwin

Unhandled error

AssertionError: expected 20482 to be 20480 // Object.is equality - Expected + Received - 20480 + 20482 ❯ onExit tests/index.test.ts:343:48 ❯ wrapper.ts:89:9 This error originated in "tests/index.test.ts" test file. It doesn't mean the error was thrown inside the file itself, but while it was running. The latest test that might've caused the error is "doesnt miss large output from fast commands". It might mean one of the following: - The error was thrown, while Vitest was running this test. - If the error occurred after the test had been completed, this was the last documented test before it was thrown.

Check failure on line 343 in tests/index.test.ts

View workflow job for this annotation

GitHub Actions / Build and test on x86_64-apple-darwin

Unhandled error

AssertionError: expected 20482 to be 20480 // Object.is equality - Expected + Received - 20480 + 20482 ❯ onExit tests/index.test.ts:343:48 ❯ wrapper.ts:89:9 This error originated in "tests/index.test.ts" test file. It doesn't mean the error was thrown inside the file itself, but while it was running. The latest test that might've caused the error is "doesnt miss large output from fast commands". It might mean one of the following: - The error was thrown, while Vitest was running this test. - If the error occurred after the test had been completed, this was the last documented test before it was thrown.

Check failure on line 343 in tests/index.test.ts

View workflow job for this annotation

GitHub Actions / Build and test on x86_64-apple-darwin

Unhandled error

AssertionError: expected 20482 to be 20480 // Object.is equality - Expected + Received - 20480 + 20482 ❯ onExit tests/index.test.ts:343:48 ❯ wrapper.ts:89:9 This error originated in "tests/index.test.ts" test file. It doesn't mean the error was thrown inside the file itself, but while it was running. The latest test that might've caused the error is "doesnt miss large output from fast commands". It might mean one of the following: - The error was thrown, while Vitest was running this test. - If the error occurred after the test had been completed, this was the last documented test before it was thrown.

Check failure on line 343 in tests/index.test.ts

View workflow job for this annotation

GitHub Actions / Build and test on aarch64-apple-darwin

Unhandled error

AssertionError: expected 20482 to be 20480 // Object.is equality - Expected + Received - 20480 + 20482 ❯ onExit tests/index.test.ts:343:48 ❯ wrapper.ts:89:9 This error originated in "tests/index.test.ts" test file. It doesn't mean the error was thrown inside the file itself, but while it was running. The latest test that might've caused the error is "doesnt miss large output from fast commands". It might mean one of the following: - The error was thrown, while Vitest was running this test. - If the error occurred after the test had been completed, this was the last documented test before it was thrown.

Check failure on line 343 in tests/index.test.ts

View workflow job for this annotation

GitHub Actions / Build and test on aarch64-apple-darwin

Unhandled error

AssertionError: expected 20482 to be 20480 // Object.is equality - Expected + Received - 20480 + 20482 ❯ onExit tests/index.test.ts:343:48 ❯ wrapper.ts:89:9 This error originated in "tests/index.test.ts" test file. It doesn't mean the error was thrown inside the file itself, but while it was running. The latest test that might've caused the error is "doesnt miss large output from fast commands". It might mean one of the following: - The error was thrown, while Vitest was running this test. - If the error occurred after the test had been completed, this was the last documented test before it was thrown.

Check failure on line 343 in tests/index.test.ts

View workflow job for this annotation

GitHub Actions / Build and test on aarch64-apple-darwin

Unhandled error

AssertionError: expected 20482 to be 20480 // Object.is equality - Expected + Received - 20480 + 20482 ❯ onExit tests/index.test.ts:343:48 ❯ wrapper.ts:89:9 This error originated in "tests/index.test.ts" test file. It doesn't mean the error was thrown inside the file itself, but while it was running. The latest test that might've caused the error is "doesnt miss large output from fast commands". It might mean one of the following: - The error was thrown, while Vitest was running this test. - If the error occurred after the test had been completed, this was the last documented test before it was thrown.

Check failure on line 343 in tests/index.test.ts

View workflow job for this annotation

GitHub Actions / Build and test on aarch64-apple-darwin

Unhandled error

AssertionError: expected 20482 to be 20480 // Object.is equality - Expected + Received - 20480 + 20482 ❯ onExit tests/index.test.ts:343:48 ❯ wrapper.ts:89:9 This error originated in "tests/index.test.ts" test file. It doesn't mean the error was thrown inside the file itself, but while it was running. The latest test that might've caused the error is "doesnt miss large output from fast commands". It might mean one of the following: - The error was thrown, while Vitest was running this test. - If the error occurred after the test had been completed, this was the last documented test before it was thrown.

Check failure on line 343 in tests/index.test.ts

View workflow job for this annotation

GitHub Actions / Build and test on aarch64-apple-darwin

Unhandled error

AssertionError: expected 20482 to be 20480 // Object.is equality - Expected + Received - 20480 + 20482 ❯ onExit tests/index.test.ts:343:48 ❯ wrapper.ts:89:9 This error originated in "tests/index.test.ts" test file. It doesn't mean the error was thrown inside the file itself, but while it was running. The latest test that might've caused the error is "doesnt miss large output from fast commands". It might mean one of the following: - The error was thrown, while Vitest was running this test. - If the error occurred after the test had been completed, this was the last documented test before it was thrown.

Check failure on line 343 in tests/index.test.ts

View workflow job for this annotation

GitHub Actions / Build and test on aarch64-apple-darwin

Unhandled error

AssertionError: expected 20482 to be 20480 // Object.is equality - Expected + Received - 20480 + 20482 ❯ onExit tests/index.test.ts:343:48 ❯ wrapper.ts:89:9 This error originated in "tests/index.test.ts" test file. It doesn't mean the error was thrown inside the file itself, but while it was running. The latest test that might've caused the error is "doesnt miss large output from fast commands". It might mean one of the following: - The error was thrown, while Vitest was running this test. - If the error occurred after the test had been completed, this was the last documented test before it was thrown.

Check failure on line 343 in tests/index.test.ts

View workflow job for this annotation

GitHub Actions / Build and test on aarch64-apple-darwin

Unhandled error

AssertionError: expected 20482 to be 20480 // Object.is equality - Expected + Received - 20480 + 20482 ❯ onExit tests/index.test.ts:343:48 ❯ wrapper.ts:89:9 This error originated in "tests/index.test.ts" test file. It doesn't mean the error was thrown inside the file itself, but while it was running. The latest test that might've caused the error is "doesnt miss large output from fast commands". It might mean one of the following: - The error was thrown, while Vitest was running this test. - If the error occurred after the test had been completed, this was the last documented test before it was thrown.

Check failure on line 343 in tests/index.test.ts

View workflow job for this annotation

GitHub Actions / Build and test on aarch64-apple-darwin

Unhandled error

AssertionError: expected 20482 to be 20480 // Object.is equality - Expected + Received - 20480 + 20482 ❯ onExit tests/index.test.ts:343:48 ❯ wrapper.ts:89:9 This error originated in "tests/index.test.ts" test file. It doesn't mean the error was thrown inside the file itself, but while it was running. The latest test that might've caused the error is "doesnt miss large output from fast commands". It might mean one of the following: - The error was thrown, while Vitest was running this test. - If the error occurred after the test had been completed, this was the last documented test before it was thrown.

Check failure on line 343 in tests/index.test.ts

View workflow job for this annotation

GitHub Actions / Build and test on aarch64-apple-darwin

Unhandled error

AssertionError: expected 20482 to be 20480 // Object.is equality - Expected + Received - 20480 + 20482 ❯ onExit tests/index.test.ts:343:48 ❯ wrapper.ts:89:9 This error originated in "tests/index.test.ts" test file. It doesn't mean the error was thrown inside the file itself, but while it was running. The latest test that might've caused the error is "doesnt miss large output from fast commands". It might mean one of the following: - The error was thrown, while Vitest was running this test. - If the error occurred after the test had been completed, this was the last documented test before it was thrown.

Check failure on line 343 in tests/index.test.ts

View workflow job for this annotation

GitHub Actions / Build and test on aarch64-apple-darwin

Unhandled error

AssertionError: expected 20482 to be 20480 // Object.is equality - Expected + Received - 20480 + 20482 ❯ onExit tests/index.test.ts:343:48 ❯ wrapper.ts:89:9 This error originated in "tests/index.test.ts" test file. It doesn't mean the error was thrown inside the file itself, but while it was running. The latest test that might've caused the error is "doesnt miss large output from fast commands". It might mean one of the following: - The error was thrown, while Vitest was running this test. - If the error occurred after the test had been completed, this was the last documented test before it was thrown.

Check failure on line 343 in tests/index.test.ts

View workflow job for this annotation

GitHub Actions / Build and test on x86_64-unknown-linux-gnu

Unhandled error

AssertionError: expected 20482 to be 20480 // Object.is equality - Expected + Received - 20480 + 20482 ❯ onExit tests/index.test.ts:343:48 ❯ wrapper.ts:89:9 This error originated in "tests/index.test.ts" test file. It doesn't mean the error was thrown inside the file itself, but while it was running. The latest test that might've caused the error is "doesnt miss large output from fast commands". It might mean one of the following: - The error was thrown, while Vitest was running this test. - If the error occurred after the test had been completed, this was the last documented test before it was thrown.

Check failure on line 343 in tests/index.test.ts

View workflow job for this annotation

GitHub Actions / Build and test on x86_64-unknown-linux-gnu

Unhandled error

AssertionError: expected 20482 to be 20480 // Object.is equality - Expected + Received - 20480 + 20482 ❯ onExit tests/index.test.ts:343:48 ❯ wrapper.ts:89:9 This error originated in "tests/index.test.ts" test file. It doesn't mean the error was thrown inside the file itself, but while it was running. The latest test that might've caused the error is "doesnt miss large output from fast commands". It might mean one of the following: - The error was thrown, while Vitest was running this test. - If the error occurred after the test had been completed, this was the last documented test before it was thrown.

Check failure on line 343 in tests/index.test.ts

View workflow job for this annotation

GitHub Actions / Build and test on x86_64-unknown-linux-gnu

Unhandled error

AssertionError: expected 20482 to be 20480 // Object.is equality - Expected + Received - 20480 + 20482 ❯ onExit tests/index.test.ts:343:48 ❯ wrapper.ts:89:9 This error originated in "tests/index.test.ts" test file. It doesn't mean the error was thrown inside the file itself, but while it was running. The latest test that might've caused the error is "doesnt miss large output from fast commands". It might mean one of the following: - The error was thrown, while Vitest was running this test. - If the error occurred after the test had been completed, this was the last documented test before it was thrown.

Check failure on line 343 in tests/index.test.ts

View workflow job for this annotation

GitHub Actions / Build and test on x86_64-unknown-linux-gnu

Unhandled error

AssertionError: expected 20482 to be 20480 // Object.is equality - Expected + Received - 20480 + 20482 ❯ onExit tests/index.test.ts:343:48 ❯ wrapper.ts:89:9 ❯ processTicksAndRejections node:internal/process/task_queues:95:5 This error originated in "tests/index.test.ts" test file. It doesn't mean the error was thrown inside the file itself, but while it was running. The latest test that might've caused the error is "doesnt miss large output from fast commands". It might mean one of the following: - The error was thrown, while Vitest was running this test. - If the error occurred after the test had been completed, this was the last documented test before it was thrown.

Check failure on line 343 in tests/index.test.ts

View workflow job for this annotation

GitHub Actions / Build and test on x86_64-unknown-linux-gnu

Unhandled error

AssertionError: expected 20482 to be 20480 // Object.is equality - Expected + Received - 20480 + 20482 ❯ onExit tests/index.test.ts:343:48 ❯ wrapper.ts:89:9 This error originated in "tests/index.test.ts" test file. It doesn't mean the error was thrown inside the file itself, but while it was running. The latest test that might've caused the error is "doesnt miss large output from fast commands". It might mean one of the following: - The error was thrown, while Vitest was running this test. - If the error occurred after the test had been completed, this was the last documented test before it was thrown.

Check failure on line 343 in tests/index.test.ts

View workflow job for this annotation

GitHub Actions / Build and test on x86_64-unknown-linux-gnu

Unhandled error

AssertionError: expected 20482 to be 20480 // Object.is equality - Expected + Received - 20480 + 20482 ❯ onExit tests/index.test.ts:343:48 ❯ wrapper.ts:89:9 ❯ processTicksAndRejections node:internal/process/task_queues:95:5 This error originated in "tests/index.test.ts" test file. It doesn't mean the error was thrown inside the file itself, but while it was running. The latest test that might've caused the error is "doesnt miss large output from fast commands". It might mean one of the following: - The error was thrown, while Vitest was running this test. - If the error occurred after the test had been completed, this was the last documented test before it was thrown.

Check failure on line 343 in tests/index.test.ts

View workflow job for this annotation

GitHub Actions / Build and test on x86_64-unknown-linux-gnu

Unhandled error

AssertionError: expected 20482 to be 20480 // Object.is equality - Expected + Received - 20480 + 20482 ❯ onExit tests/index.test.ts:343:48 ❯ wrapper.ts:89:9 ❯ processTicksAndRejections node:internal/process/task_queues:95:5 This error originated in "tests/index.test.ts" test file. It doesn't mean the error was thrown inside the file itself, but while it was running. The latest test that might've caused the error is "doesnt miss large output from fast commands". It might mean one of the following: - The error was thrown, while Vitest was running this test. - If the error occurred after the test had been completed, this was the last documented test before it was thrown.

Check failure on line 343 in tests/index.test.ts

View workflow job for this annotation

GitHub Actions / Build and test on x86_64-unknown-linux-gnu

Unhandled error

AssertionError: expected 20482 to be 20480 // Object.is equality - Expected + Received - 20480 + 20482 ❯ onExit tests/index.test.ts:343:48 ❯ wrapper.ts:89:9 ❯ processTicksAndRejections node:internal/process/task_queues:95:5 This error originated in "tests/index.test.ts" test file. It doesn't mean the error was thrown inside the file itself, but while it was running. The latest test that might've caused the error is "doesnt miss large output from fast commands". It might mean one of the following: - The error was thrown, while Vitest was running this test. - If the error occurred after the test had been completed, this was the last documented test before it was thrown.

Check failure on line 343 in tests/index.test.ts

View workflow job for this annotation

GitHub Actions / Build and test on x86_64-unknown-linux-gnu

Unhandled error

AssertionError: expected 20482 to be 20480 // Object.is equality - Expected + Received - 20480 + 20482 ❯ onExit tests/index.test.ts:343:48 ❯ wrapper.ts:89:9 ❯ processTicksAndRejections node:internal/process/task_queues:95:5 This error originated in "tests/index.test.ts" test file. It doesn't mean the error was thrown inside the file itself, but while it was running. The latest test that might've caused the error is "doesnt miss large output from fast commands". It might mean one of the following: - The error was thrown, while Vitest was running this test. - If the error occurred after the test had been completed, this was the last documented test before it was thrown.

Check failure on line 343 in tests/index.test.ts

View workflow job for this annotation

GitHub Actions / Build and test on x86_64-unknown-linux-gnu

Unhandled error

AssertionError: expected 20482 to be 20480 // Object.is equality - Expected + Received - 20480 + 20482 ❯ onExit tests/index.test.ts:343:48 ❯ wrapper.ts:89:9 ❯ processTicksAndRejections node:internal/process/task_queues:95:5 This error originated in "tests/index.test.ts" test file. It doesn't mean the error was thrown inside the file itself, but while it was running. The latest test that might've caused the error is "doesnt miss large output from fast commands". It might mean one of the following: - The error was thrown, while Vitest was running this test. - If the error occurred after the test had been completed, this was the last documented test before it was thrown.
done();
},
});

const readStream = pty.read;
readStream.on('data', (data) => {
buffer = Buffer.concat([buffer, data]);
});
})
);

testSkipOnDarwin(
'does not leak files',
{ repeats: 4 },
Expand Down

0 comments on commit 3c2c102

Please sign in to comment.