Skip to content

Commit 0f16dc2

Browse files
committed
fix test
1 parent 8408336 commit 0f16dc2

File tree

119 files changed

+127
-129
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

119 files changed

+127
-129
lines changed

modules/10-basics/10-hello-world/test.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@ test('hello world', async () => {
66
const consoleLogSpy = vi.spyOn(console, 'log').mockImplementation(() => { });
77
await import('./index.js')
88

9-
const firstArg = consoleLogSpy.mock.calls[0]?.[0];
9+
const firstArg = consoleLogSpy.mock.calls.join('\n');
1010

1111
expect(firstArg).toBe('Hello, World!')
1212
})
Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,2 +1,2 @@
11
test:
2-
@ test-output.sh
2+
@ test2.sh
Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,2 +1,2 @@
11
test:
2-
@ test-output.sh
2+
@ test2.sh

modules/10-basics/40-instructions/test.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@ test('hello world', async () => {
66
const consoleLogSpy = vi.spyOn(console, 'log').mockImplementation(() => { });
77
await import('./index.js')
88

9-
const firstArg = consoleLogSpy.mock.calls[0]?.[0];
9+
const firstArg = consoleLogSpy.mock.calls.join('\n');
1010

1111
expect(firstArg).toBe('Robert\nStannis\nRenly')
1212
})

modules/10-basics/45-testing/Makefile

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,2 +1,2 @@
11
test:
2-
@ test-output.sh
2+
@ test2.sh

modules/10-basics/45-testing/test.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@ test('hello world', async () => {
66
const consoleLogSpy = vi.spyOn(console, 'log').mockImplementation(() => { });
77
await import('./index.js')
88

9-
const firstArg = consoleLogSpy.mock.calls[0]?.[0];
9+
const firstArg = consoleLogSpy.mock.calls.join('\n');
1010

1111
expect(firstArg).toBe('9780262531962')
1212
})
Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,2 +1,2 @@
11
test:
2-
@ test-output.sh
2+
@ test2.sh

modules/10-basics/50-syntax-errors/test.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@ test('hello world', async () => {
66
const consoleLogSpy = vi.spyOn(console, 'log').mockImplementation(() => { });
77
await import('./index.js')
88

9-
const firstArg = consoleLogSpy.mock.calls[0]?.[0];
9+
const firstArg = consoleLogSpy.mock.calls.join('\n');
1010

1111
expect(firstArg).toBe('What Is Dead May Never Die')
1212
})
Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,2 +1,2 @@
11
test:
2-
@ test-output.sh
2+
@ test2.sh

modules/20-arithmetics/20-basic/test.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@ test('hello world', async () => {
66
const consoleLogSpy = vi.spyOn(console, 'log').mockImplementation(() => { });
77
await import('./index.js')
88

9-
const firstArg = consoleLogSpy.mock.calls[0]?.[0];
9+
const firstArg = consoleLogSpy.mock.calls.join('\n');
1010

1111
expect(firstArg).toBe('9')
1212
})
Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,2 +1,2 @@
11
test:
2-
@ test-output.sh
2+
@ test2.sh

modules/20-arithmetics/25-operator/test.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@ test('hello world', async () => {
66
const consoleLogSpy = vi.spyOn(console, 'log').mockImplementation(() => { });
77
await import('./index.js')
88

9-
const firstArg = consoleLogSpy.mock.calls[0]?.[0];
9+
const firstArg = consoleLogSpy.mock.calls.join('\n');
1010

1111
expect(firstArg).toBe('87')
1212
})
Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,2 +1,2 @@
11
test:
2-
@ test-output.sh
2+
@ test2.sh

modules/20-arithmetics/27-commutativity/test.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@ test('hello world', async () => {
66
const consoleLogSpy = vi.spyOn(console, 'log').mockImplementation(() => { });
77
await import('./index.js')
88

9-
const firstArg = consoleLogSpy.mock.calls[0]?.[0];
9+
const firstArg = consoleLogSpy.mock.calls.join('\n');
1010

1111
expect(firstArg).toBe('243\n2')
1212
})
Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,2 +1,2 @@
11
test:
2-
@ test-output.sh
2+
@ test2.sh

modules/20-arithmetics/30-composition/test.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@ test('hello world', async () => {
66
const consoleLogSpy = vi.spyOn(console, 'log').mockImplementation(() => { });
77
await import('./index.js')
88

9-
const firstArg = consoleLogSpy.mock.calls[0]?.[0];
9+
const firstArg = consoleLogSpy.mock.calls.join('\n');
1010

1111
expect(firstArg).toBe('10.5')
1212
})
Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,2 +1,2 @@
11
test:
2-
@ test-output.sh
2+
@ test2.sh

modules/20-arithmetics/40-priority/test.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@ test('hello world', async () => {
66
const consoleLogSpy = vi.spyOn(console, 'log').mockImplementation(() => { });
77
await import('./index.js')
88

9-
const firstArg = consoleLogSpy.mock.calls[0]?.[0];
9+
const firstArg = consoleLogSpy.mock.calls.join('\n');
1010

1111
expect(firstArg).toBe('49')
1212
})
Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,2 +1,2 @@
11
test:
2-
@ test-output.sh
2+
@ test2.sh

modules/20-arithmetics/50-float/test.js

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@ test('hello world', async () => {
66
const consoleLogSpy = vi.spyOn(console, 'log').mockImplementation(() => { });
77
await import('./index.js')
88

9-
const firstArg = consoleLogSpy.mock.calls[0]?.[0];
9+
const firstArg = consoleLogSpy.mock.calls.join('\n');
1010

11-
expect(firstArg).toBe('0.39 * 0.22')
11+
expect(firstArg).toBe('0.0858')
1212
})
Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,2 +1,2 @@
11
test:
2-
@ test-output.sh
2+
@ test2.sh

modules/20-arithmetics/60-infinity/test.js

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@ test('hello world', async () => {
66
const consoleLogSpy = vi.spyOn(console, 'log').mockImplementation(() => { });
77
await import('./index.js')
88

9-
const firstArg = consoleLogSpy.mock.calls[0]?.[0];
9+
const firstArg = consoleLogSpy.mock.calls.join('\n');
1010

11-
expect(firstArg).toBe(Infinity)
11+
expect(firstArg).toBe('Infinity')
1212
})
Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,2 +1,2 @@
11
test:
2-
@ test-output.sh
2+
@ test2.sh

modules/20-arithmetics/70-nan/test.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@ test('hello world', async () => {
66
const consoleLogSpy = vi.spyOn(console, 'log').mockImplementation(() => { });
77
await import('./index.js')
88

9-
const firstArg = consoleLogSpy.mock.calls[0]?.[0];
9+
const firstArg = consoleLogSpy.mock.calls.join('\n');
1010

1111
expect(firstArg).toBe('NaN')
1212
})
Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,2 +1,2 @@
11
test:
2-
@ test-output.sh
2+
@ test2.sh

modules/20-arithmetics/80-linting/test.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@ test('hello world', async () => {
66
const consoleLogSpy = vi.spyOn(console, 'log').mockImplementation(() => { });
77
await import('./index.js')
88

9-
const firstArg = consoleLogSpy.mock.calls[0]?.[0];
9+
const firstArg = consoleLogSpy.mock.calls.join('\n');
1010

1111
expect(firstArg).toBe('4')
1212
})

modules/25-strings/10-quotes/Makefile

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,2 +1,2 @@
11
test:
2-
@ test-output.sh
2+
@ test2.sh

modules/25-strings/10-quotes/test.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@ test('hello world', async () => {
66
const consoleLogSpy = vi.spyOn(console, 'log').mockImplementation(() => { });
77
await import('./index.js')
88

9-
const firstArg = consoleLogSpy.mock.calls[0]?.[0];
9+
const firstArg = consoleLogSpy.mock.calls.join('\n');
1010

1111
expect(firstArg).toBe("\"Khal Drogo's favorite word is \"athjahakar\"\"")
1212
})
Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,2 +1,2 @@
11
test:
2-
@ test-output.sh
2+
@ test2.sh

modules/25-strings/15-escape-characters/test.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@ test('hello world', async () => {
66
const consoleLogSpy = vi.spyOn(console, 'log').mockImplementation(() => { });
77
await import('./index.js')
88

9-
const firstArg = consoleLogSpy.mock.calls[0]?.[0];
9+
const firstArg = consoleLogSpy.mock.calls.join('\n');
1010

1111
expect(firstArg).toBe('- Did Joffrey agree?\n- He did. He also said "I love using \\n".')
1212
})
Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,2 +1,2 @@
11
test:
2-
@ test-output.sh
2+
@ test2.sh

modules/25-strings/20-string-concatenation/test.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@ test('hello world', async () => {
66
const consoleLogSpy = vi.spyOn(console, 'log').mockImplementation(() => { });
77
await import('./index.js')
88

9-
const firstArg = consoleLogSpy.mock.calls[0]?.[0];
9+
const firstArg = consoleLogSpy.mock.calls.join('\n');
1010

1111
expect(firstArg).toBe('Winter came for the House of Frey.')
1212
})
Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,2 +1,2 @@
11
test:
2-
@ test-output.sh
2+
@ test2.sh

modules/25-strings/30-encoding/test.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@ test('hello world', async () => {
66
const consoleLogSpy = vi.spyOn(console, 'log').mockImplementation(() => { });
77
await import('./index.js')
88

9-
const firstArg = consoleLogSpy.mock.calls[0]?.[0];
9+
const firstArg = consoleLogSpy.mock.calls.join('\n');
1010

1111
expect(firstArg).toBe('~\n^\n%')
1212
})
Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,2 +1,2 @@
11
test:
2-
@ test-output.sh
2+
@ test2.sh

modules/30-variables/10-definition/test.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@ test('hello world', async () => {
66
const consoleLogSpy = vi.spyOn(console, 'log').mockImplementation(() => { });
77
await import('./index.js')
88

9-
const firstArg = consoleLogSpy.mock.calls[0]?.[0];
9+
const firstArg = consoleLogSpy.mock.calls.join('\n');
1010

1111
expect(firstArg).toBe('What Is Dead May Never Die!')
1212
})
Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,2 +1,2 @@
11
test:
2-
@ test-output.sh
2+
@ test2.sh

modules/30-variables/11-change/test.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@ test('hello world', async () => {
66
const consoleLogSpy = vi.spyOn(console, 'log').mockImplementation(() => { });
77
await import('./index.js')
88

9-
const firstArg = consoleLogSpy.mock.calls[0]?.[0];
9+
const firstArg = consoleLogSpy.mock.calls.join('\n');
1010

1111
expect(firstArg).toBe('anneirB')
1212
})
Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,2 +1,2 @@
11
test:
2-
@ test-output.sh
2+
@ test2.sh

modules/30-variables/13-variables-naming/test.js

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@ test('hello world', async () => {
66
const consoleLogSpy = vi.spyOn(console, 'log').mockImplementation(() => { });
77
await import('./index.js')
88

9-
const firstArg = consoleLogSpy.mock.calls[0]?.[0];
9+
const firstArg = consoleLogSpy.mock.calls.join('\n');
1010

11-
expect(firstArg).toBe(2)
11+
expect(firstArg).toBe('2')
1212
})
Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,2 +1,2 @@
11
test:
2-
@ test-output.sh
2+
@ test2.sh

modules/30-variables/14-errors/test.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@ test('hello world', async () => {
66
const consoleLogSpy = vi.spyOn(console, 'log').mockImplementation(() => { });
77
await import('./index.js')
88

9-
const firstArg = consoleLogSpy.mock.calls[0]?.[0];
9+
const firstArg = consoleLogSpy.mock.calls.join('\n');
1010

1111
expect(firstArg).toBe('Targaryen\nand\nDragon')
1212
})
Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,2 +1,2 @@
11
test:
2-
@ test-output.sh
2+
@ test2.sh

modules/30-variables/15-variables-expressions/test.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@ test('hello world', async () => {
66
const consoleLogSpy = vi.spyOn(console, 'log').mockImplementation(() => { });
77
await import('./index.js')
88

9-
const firstArg = consoleLogSpy.mock.calls[0]?.[0];
9+
const firstArg = consoleLogSpy.mock.calls.join('\n');
1010

1111
expect(firstArg).toBe('125\n863.75')
1212
})
Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,2 +1,2 @@
11
test:
2-
@ test-output.sh
2+
@ test2.sh

modules/30-variables/18-variable-concatenation/test.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@ test('hello world', async () => {
66
const consoleLogSpy = vi.spyOn(console, 'log').mockImplementation(() => { });
77
await import('./index.js')
88

9-
const firstArg = consoleLogSpy.mock.calls[0]?.[0];
9+
const firstArg = consoleLogSpy.mock.calls.join('\n');
1010

1111
expect(firstArg).toBe("Hello, Joffrey!\nHere is important information about your account security.\nWe couldn't verify your mother's maiden name.")
1212
})
Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,2 +1,2 @@
11
test:
2-
@ test-output.sh
2+
@ test2.sh

modules/30-variables/19-naming-style/test.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@ test('hello world', async () => {
66
const consoleLogSpy = vi.spyOn(console, 'log').mockImplementation(() => { });
77
await import('./index.js')
88

9-
const firstArg = consoleLogSpy.mock.calls[0]?.[0];
9+
const firstArg = consoleLogSpy.mock.calls.join('\n');
1010

1111
expect(firstArg).toBe('-1100')
1212
})
Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,2 +1,2 @@
11
test:
2-
@ test-output.sh
2+
@ test2.sh

modules/30-variables/20-magic-numbers/test.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@ test('hello world', async () => {
66
const consoleLogSpy = vi.spyOn(console, 'log').mockImplementation(() => { });
77
await import('./index.js')
88

9-
const firstArg = consoleLogSpy.mock.calls[0]?.[0];
9+
const firstArg = consoleLogSpy.mock.calls.join('\n');
1010

1111
expect(firstArg).toBe('King Balon the 6th has 102 rooms.')
1212
})
Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,2 +1,2 @@
11
test:
2-
@ test-output.sh
2+
@ test2.sh

modules/30-variables/23-constants/test.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@ test('hello world', async () => {
66
const consoleLogSpy = vi.spyOn(console, 'log').mockImplementation(() => { });
77
await import('./index.js')
88

9-
const firstArg = consoleLogSpy.mock.calls[0]?.[0];
9+
const firstArg = consoleLogSpy.mock.calls.join('\n');
1010

1111
expect(firstArg).toBe('the white walkers')
1212
})
Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,2 +1,2 @@
11
test:
2-
@ test-output.sh
2+
@ test2.sh

modules/30-variables/25-interpolation/test.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@ test('hello world', async () => {
66
const consoleLogSpy = vi.spyOn(console, 'log').mockImplementation(() => { });
77
await import('./index.js')
88

9-
const firstArg = consoleLogSpy.mock.calls[0]?.[0];
9+
const firstArg = consoleLogSpy.mock.calls.join('\n');
1010

1111
expect(firstArg).toBe('Do you want to eat, Arya?')
1212
})
Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,2 +1,2 @@
11
test:
2-
@ test-output.sh
2+
@ test2.sh

modules/30-variables/30-symbols/test.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@ test('hello world', async () => {
66
const consoleLogSpy = vi.spyOn(console, 'log').mockImplementation(() => { });
77
await import('./index.js')
88

9-
const firstArg = consoleLogSpy.mock.calls[0]?.[0];
9+
const firstArg = consoleLogSpy.mock.calls.join('\n');
1010

1111
expect(firstArg).toBe('s')
1212
})
Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,2 +1,2 @@
11
test:
2-
@ test-output.sh
2+
@ test2.sh

modules/33-data-types/10-primitive-data-types/test.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@ test('hello world', async () => {
66
const consoleLogSpy = vi.spyOn(console, 'log').mockImplementation(() => { });
77
await import('./index.js')
88

9-
const firstArg = consoleLogSpy.mock.calls[0]?.[0];
9+
const firstArg = consoleLogSpy.mock.calls.join('\n');
1010

1111
expect(firstArg).toBe('-0.304')
1212
})
Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,2 +1,2 @@
11
test:
2-
@ test-output.sh
2+
@ test2.sh

modules/33-data-types/45-undefined/test.js

Lines changed: 1 addition & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -8,8 +8,5 @@ test('hello world', async () => {
88

99
const firstArg = consoleLogSpy.mock.calls[0]?.[0];
1010

11-
expect(firstArg).toBe('undefined')
11+
expect(firstArg).toBe(undefined)
1212
})
13-
14-
const expected = 'undefined';
15-
expectOutput(expected);
Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,2 +1,2 @@
11
test:
2-
@ test-output.sh
2+
@ test2.sh

0 commit comments

Comments
 (0)