Skip to content

Commit 09a75bc

Browse files
committed
Move variables
1 parent 9b1b7ed commit 09a75bc

File tree

1 file changed

+4
-3
lines changed

1 file changed

+4
-3
lines changed

tests/button.test.tsx

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -21,9 +21,6 @@ describe('Buttons', () => {
2121
});
2222

2323
it('should connect to InSim and send a button', (done) => {
24-
let root: ReturnType<typeof createRoot>;
25-
let receivedPackets: Buffer[] = [];
26-
2724
const createRootOptions: CreateRootOptions = {
2825
name: 'Test App',
2926
host: '127.0.0.1',
@@ -32,6 +29,8 @@ describe('Buttons', () => {
3229
prefix: '!',
3330
};
3431

32+
let root: ReturnType<typeof createRoot>;
33+
3534
process.nextTick(() => {
3635
root = createRoot(createRootOptions);
3736
root.render(
@@ -45,6 +44,8 @@ describe('Buttons', () => {
4544
expect(opts.host).toEqual('127.0.0.1');
4645
expect(opts.port).toEqual(29999);
4746

47+
let receivedPackets: Buffer[] = [];
48+
4849
socket.on('data', (data) => {
4950
receivedPackets.push(data);
5051
const combined = Buffer.concat(receivedPackets);

0 commit comments

Comments
 (0)