-
Notifications
You must be signed in to change notification settings - Fork 183
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Fix Windows CI via node+jest (as alternative to bun)
- Loading branch information
Showing
15 changed files
with
134 additions
and
55 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
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,16 @@ | ||
import { promises as fs } from 'node:fs' | ||
import { join } from 'node:path' | ||
import { init } from '../src/init.js' | ||
|
||
// temporary directory | ||
const root = '_test' | ||
|
||
// setup and teardown | ||
beforeAll(async () => await fs.mkdir(root, { recursive: true })) | ||
afterAll(async () => await fs.rm(root, { recursive: true, force: true })) | ||
|
||
test('init dist/@nue dir', async () => { | ||
await init({ dist: root, is_dev: true, esbuild: false }) | ||
const names = await fs.readdir(join(root, '@nue')) | ||
expect(names.length).toBeGreaterThan(7) | ||
}) |
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,26 @@ | ||
import { getPosixPath } from '../src/util.js' | ||
|
||
// https://stackoverflow.com/questions/67325342/how-to-run-os-agnostic-jest-test-files-that-check-paths | ||
// https://jestjs.io/docs/expect#expectextendmatchers | ||
export function toMatchPath(actual, expected) { | ||
const { printReceived, printExpected, matcherHint } = this.utils | ||
|
||
const pass = getPosixPath(actual) == expected | ||
|
||
return { | ||
pass, | ||
message: () => pass | ||
? matcherHint('.not.toMatchPath') + | ||
'\n\n' + | ||
'Expected path not to match:\n' + | ||
` ${printExpected(expected)}\n` + | ||
'Received:\n' + | ||
` ${printReceived(actual)}` | ||
: matcherHint('.toMatchPath') + | ||
'\n\n' + | ||
'Expected path to match:\n' + | ||
` ${printExpected(expected)}\n` + | ||
'Received:\n' + | ||
` ${printReceived(actual)}` | ||
} | ||
} |
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
Oops, something went wrong.