Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
12 changes: 6 additions & 6 deletions server/src/shfmt/__tests__/index.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -55,21 +55,21 @@ describe('formatter', () => {
})

it('should throw when formatting fails', async () => {
expect(async () => {
await expect(async () => {
await getFormattingResult({ document: FIXTURE_DOCUMENT.PARSE_PROBLEMS })
}).rejects.toThrow(
/Shfmt: exited with status 1: .*\/testing\/fixtures\/parse-problems.sh:10:1: > must be followed by a word/,
/Shfmt: exited with status 1: .*\/testing\/fixtures\/parse-problems.sh:10:1: [`"']?>[`"']? must be followed by a word/,
)
})

it('should throw when parsing using the wrong language dialect', async () => {
expect(async () => {
await expect(async () => {
await getFormattingResult({
document: FIXTURE_DOCUMENT.SHFMT,
shfmtConfig: { languageDialect: 'posix' },
})
}).rejects.toThrow(
/Shfmt: exited with status 1: .*\/testing\/fixtures\/shfmt\.sh:25:14: (the "function" builtin|a command can only contain words and redirects; encountered \()/,
/Shfmt: exited with status 1: .*\/testing\/fixtures\/shfmt\.sh:25:14: (the [`"']?function[`"']? builtin|a command can only contain words and redirects; encountered \()/,
)
})

Expand Down Expand Up @@ -607,10 +607,10 @@ describe('formatter', () => {
FIXTURE_DOCUMENT.PARSE_PROBLEMS.getText(),
)

expect(async () => {
await expect(async () => {
await getFormattingResult({ document: testDocument })
}).rejects.toThrow(
/Shfmt: exited with status 1: <standard input>:10:1: > must be followed by a word/,
/Shfmt: exited with status 1: <standard input>:10:1: [`"']?>[`"']? must be followed by a word/,
)
})

Expand Down
Loading