-
Notifications
You must be signed in to change notification settings - Fork 29
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
fix: import next.config.js in Windows (#159)
* chore: add windows ci test * fix: dynamic import file path in Windows * fix: try forward slashes * chore: log out file path * fix: pathToFileURL().href related issue nodejs/node#34765 * chore: log out error * fix: try adding cwd() * fix: cross platform write file script related shelljs/shx#192 * fix: try next-video/process import * fix: cross platform glob expansion * chore: use codecov v4 * chore: move next.config.js mock test file
- Loading branch information
Showing
6 changed files
with
58 additions
and
19 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,22 @@ | ||
import assert from 'node:assert'; | ||
import { describe, it, before, after } from 'node:test'; | ||
import { getVideoConfig } from '../src/config.js'; | ||
|
||
describe('config', () => { | ||
before(() => { | ||
process.chdir('tests'); | ||
}); | ||
|
||
after(() => { | ||
process.chdir('../'); | ||
}); | ||
|
||
it('getVideoConfig', async () => { | ||
// Test that the default config is returned if no next.config.js file is found. | ||
const videoConfig = await getVideoConfig(); | ||
assert.equal(videoConfig.folder, 'videos'); | ||
assert.equal(videoConfig.path, '/api/video'); | ||
assert.equal(videoConfig.provider, 'mux'); | ||
assert.deepStrictEqual(videoConfig.providerConfig, {}); | ||
}); | ||
}); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,7 @@ | ||
// This file is used in the tests to mock the next.config.js file!!! | ||
import { withNextVideo } from 'next-video/process'; | ||
|
||
/** @type {import('next').NextConfig} */ | ||
const nextConfig = {}; | ||
|
||
export default withNextVideo(nextConfig); |