Skip to content

Commit

Permalink
fix: run tests with a different locale
Browse files Browse the repository at this point in the history
  • Loading branch information
leinelissen committed Dec 3, 2024
1 parent ec584d0 commit d5de85f
Show file tree
Hide file tree
Showing 3 changed files with 17 additions and 3 deletions.
9 changes: 8 additions & 1 deletion .github/workflows/test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ jobs:
strategy:
fail-fast: false
matrix:
os: [ubuntu-latest, windows-latest, macos-latest]
os: [ubuntu-latest, windows-latest, macos-latest, macos-13]
runs-on: ${{ matrix.os }}

steps:
Expand All @@ -26,6 +26,13 @@ jobs:
run: |
cd packages/embedded-postgres
npm test
- name: Run test (NL locale)
env:
LC_ALL: nl_NL.utf8
if: matrix.os != 'windows-latest'
run: |
cd packages/embedded-postgres
npm test
9 changes: 8 additions & 1 deletion packages/embedded-postgres/src/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -146,7 +146,14 @@ class EmbeddedPostgres {
`--pwfile=${passwordFile}`,
`--lc-messages=${LC_MESSAGES_LOCALE}`,
...this.options.initdbFlags,
], { stdio: 'inherit', ...permissionIds, });
], { ...permissionIds, env: { LC_MESSAGES: LC_MESSAGES_LOCALE } });

// Connect to stderr, as that is where the messages get sent
process.stdout?.on('data', (chunk: Buffer) => {
// Parse the data as a string and log it
const message = chunk.toString('utf-8');
this.options.onLog(message);
});

process.on('exit', (code) => {
if (code === 0) {
Expand Down
2 changes: 1 addition & 1 deletion packages/embedded-postgres/tests/index.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@ afterEach(async () => {
await pg?.stop();

// Remove all cluster files
await fs.rm(path.join(DB_PATH), { recursive: true, force: true });
// await fs.rm(path.join(DB_PATH), { recursive: true, force: true });
});

it('should be able to initialise a cluster', async () => {
Expand Down

0 comments on commit d5de85f

Please sign in to comment.