Skip to content

Commit

Permalink
test: server works with filenames containing spaces
Browse files Browse the repository at this point in the history
  • Loading branch information
cossssmin committed Sep 10, 2024
1 parent d7053a8 commit 42a8e3b
Show file tree
Hide file tree
Showing 3 changed files with 8 additions and 3 deletions.
6 changes: 3 additions & 3 deletions test/build.test.js
Original file line number Diff line number Diff line change
Expand Up @@ -114,10 +114,10 @@ describe.concurrent('Build', () => {
}
).then(({ files }) => files)

expect(ctx.arrayGlobFiles.length).toBe(3)
expect(ctx.arrayGlobFiles.length).toBe(4)
expect(ctx.arrayGlobFiles).toContain(`${ctx.folder}/test/fixtures/build/beforeCreate.php`)

expect(ctx.stringGlobFiles.length).toBe(5)
expect(ctx.stringGlobFiles.length).toBe(6)
expect(ctx.stringGlobFiles).toContain(`${ctx.folder}/str/filters.html`)
})

Expand Down Expand Up @@ -169,7 +169,7 @@ describe.concurrent('Build', () => {
}
).then(({ files }) => files)

expect(ctx.files.length).toBe(4)
expect(ctx.files.length).toBe(5)
expect(ctx.files).toContain(`${ctx.folder}/test/fixtures/build/image.png`)
})

Expand Down
1 change: 1 addition & 0 deletions test/fixtures/build/with spaces.html
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
works
4 changes: 4 additions & 0 deletions test/server.test.js
Original file line number Diff line number Diff line change
Expand Up @@ -68,9 +68,13 @@ describe.concurrent('Server', () => {

test('Renders template', async () => {
const res = await request('http://localhost:3000').get('/expandLinkTag.html')
const res2 = await request('http://localhost:3000').get('/with spaces.html')

expect(res.status).toBe(200)
expect(res.text).toContain('<style>.hidden {')

expect(res2.status).toBe(200)
expect(res2.text).toContain('works')
})

test('404 page', async () => {
Expand Down

0 comments on commit 42a8e3b

Please sign in to comment.