Skip to content

Commit

Permalink
chore: Formatting
Browse files Browse the repository at this point in the history
  • Loading branch information
rschristian committed Nov 4, 2024
1 parent 7bb85fd commit f83178d
Show file tree
Hide file tree
Showing 3 changed files with 12 additions and 12 deletions.
8 changes: 4 additions & 4 deletions src/options.ts
Original file line number Diff line number Diff line change
Expand Up @@ -105,10 +105,10 @@ export type ViteStaticCopyOptions = {
*/
reloadPageOnChange?: boolean
}
/**
* Rollup hook the plugin should use during build.
* @default 'writeBundle'
*/
/**
* Rollup hook the plugin should use during build.
* @default 'writeBundle'
*/
hook?: string
}

Expand Down
12 changes: 7 additions & 5 deletions test/fixtures/vite.hook.config.ts
Original file line number Diff line number Diff line change
Expand Up @@ -13,20 +13,22 @@ export default defineConfig({
{
src: 'foo.txt',
dest: 'hook1'
},
}
],
hook: 'generateBundle',
hook: 'generateBundle'
}),
testHookPlugin(),
testHookPlugin()
]
})

function testHookPlugin() {
return {
name: 'test-hook-plugin',
async writeBundle() {
const filePath = normalizePath(path.resolve(_dirname, 'dist', 'hook1', 'foo.txt'));
await fs.access(filePath);
const filePath = normalizePath(
path.resolve(_dirname, 'dist', 'hook1', 'foo.txt')
)
await fs.access(filePath)
}
}
}
4 changes: 1 addition & 3 deletions test/tests.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -140,9 +140,7 @@ describe('build', () => {

describe('hook', () => {
test('should support hook option', async () => {
expect(
await build(getConfig('vite.hook.config.ts'))
).not.toThrow()
expect(await build(getConfig('vite.hook.config.ts'))).not.toThrow()

Check failure on line 143 in test/tests.test.ts

View workflow job for this annotation

GitHub Actions / run test (18.x, ubuntu-latest)

AssertionError: expected { output: [ { …(8) } ] } to be a function

at test/tests.test.ts:143:65

Check failure on line 143 in test/tests.test.ts

View workflow job for this annotation

GitHub Actions / run test (20.x, ubuntu-latest)

AssertionError: expected { output: [ { …(8) } ] } to be a function

at test/tests.test.ts:143:65

Check failure on line 143 in test/tests.test.ts

View workflow job for this annotation

GitHub Actions / run test (22.x, ubuntu-latest)

AssertionError: expected { output: [ { …(8) } ] } to be a function

at test/tests.test.ts:143:65

Check failure on line 143 in test/tests.test.ts

View workflow job for this annotation

GitHub Actions / run test (20.x, windows-latest)

AssertionError: expected { output: [ { …(8) } ] } to be a function

at D:/a/vite-plugin-static-copy/vite-plugin-static-copy/test/tests.test.ts:143:65
})
})

Expand Down

0 comments on commit f83178d

Please sign in to comment.