Skip to content

Commit

Permalink
test: fix
Browse files Browse the repository at this point in the history
  • Loading branch information
Princesseuh committed Apr 12, 2024
1 parent 9d0180e commit 79d6550
Showing 1 changed file with 4 additions and 2 deletions.
6 changes: 4 additions & 2 deletions packages/astro/test/units/config/config-tsconfig.test.js
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,8 @@ import * as path from 'node:path';
import { describe, it } from 'node:test';
import { fileURLToPath } from 'node:url';
import { loadTSConfig, updateTSConfigForFramework } from '../../../dist/core/config/index.js';
import { readFileSync } from 'node:fs';
import { readFile } from 'node:fs/promises';
import { toJson } from 'tsconfck';

const cwd = fileURLToPath(new URL('../../fixtures/tsconfig-handling/', import.meta.url));

Expand Down Expand Up @@ -41,7 +42,8 @@ describe('TSConfig handling', () => {

it('does not change baseUrl in raw config', async () => {
const loadedConfig = await loadTSConfig(path.join(cwd, 'baseUrl'));
const rawConfig = readFileSync(path.join(cwd, 'baseUrl', 'tsconfig.json'), 'utf-8');
const rawConfig = await readFile(path.join(cwd, 'baseUrl', 'tsconfig.json'), 'utf-8').then(toJson)
.then((content) => JSON.parse(content));

assert.deepEqual(loadedConfig.rawConfig, rawConfig);
});
Expand Down

0 comments on commit 79d6550

Please sign in to comment.