Skip to content

Commit

Permalink
toString the buffer
Browse files Browse the repository at this point in the history
  • Loading branch information
NullVoxPopuli committed Jul 14, 2023
1 parent 6a3683e commit e00c320
Show file tree
Hide file tree
Showing 4 changed files with 8 additions and 4 deletions.
5 changes: 4 additions & 1 deletion tests/assertions.ts
Original file line number Diff line number Diff line change
Expand Up @@ -91,5 +91,8 @@ export async function matchesFixture(
let sourceContents = await fs.readFile(testFilePath);
let fixtureContents = await fixture(fixtureFile, { scenario });

expect(sourceContents).to.equal(fixtureContents, `${testFilePath} matches ${fixtureFile}`);
expect(sourceContents.toString()).to.equal(
fixtureContents,
`${testFilePath} matches ${fixtureFile}`
);
}
3 changes: 2 additions & 1 deletion tests/smoke-tests/--typescript.test.ts
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
import fs from 'node:fs/promises';
import path from 'node:path';
import { afterAll, beforeAll, describe, expect, it } from 'vitest';

Expand Down Expand Up @@ -34,7 +35,7 @@ for (let packageManager of SUPPORTED_PACKAGE_MANAGERS) {
});

afterAll(async () => {
// await fs.rm(tmpDir, { recursive: true, force: true });
await fs.rm(tmpDir, { recursive: true, force: true });
});

it('was generated correctly', async () => {
Expand Down
2 changes: 1 addition & 1 deletion tests/smoke-tests/defaults.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,7 @@ for (let packageManager of SUPPORTED_PACKAGE_MANAGERS) {
});

afterAll(async () => {
fs.rm(tmpDir, { recursive: true, force: true });
// fs.rm(tmpDir, { recursive: true, force: true });
});

it('is using the correct packager', async () => {
Expand Down
2 changes: 1 addition & 1 deletion tests/utils.ts
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@ export async function fixture(
}
) {
let scenario = options?.scenario ?? 'default';
let fixtureFilePath = path.join(fixturesPath, scenario, file);
let fixtureFilePath = path.isAbsolute(file) ? file : path.join(fixturesPath, scenario, file);
let contents = await fs.readFile(fixtureFilePath);

return contents.toString();
Expand Down

0 comments on commit e00c320

Please sign in to comment.