Skip to content

Commit

Permalink
Windows path
Browse files Browse the repository at this point in the history
  • Loading branch information
ascorbic committed Jul 4, 2024
1 parent d8aa5a5 commit 3b77d4c
Showing 1 changed file with 10 additions and 6 deletions.
16 changes: 10 additions & 6 deletions packages/astro/test/content-layer.test.js
Original file line number Diff line number Diff line change
@@ -1,6 +1,8 @@
import assert from 'node:assert/strict';
import { after, before, describe, it } from 'node:test';
import { loadFixture } from './test-utils.js';
import { sep } from 'node:path';
import { sep as posixSep } from 'node:path/posix';

describe('Content Layer', () => {
/** @type {import("./test-utils.js").Fixture} */
Expand Down Expand Up @@ -73,9 +75,10 @@ describe('Content Layer', () => {
it('Returns data entry by id', async () => {
assert.ok(json.hasOwnProperty('dataEntry'));
assert.ok(
json.dataEntry.filePath?.endsWith(
'packages/astro/test/fixtures/content-layer/src/data/dogs.json'
)
json.dataEntry.filePath
?.split(sep)
.join(posixSep)
.endsWith('packages/astro/test/fixtures/content-layer/src/data/dogs.json')
);
delete json.dataEntry.filePath;
assert.deepEqual(json.dataEntry, {
Expand Down Expand Up @@ -180,9 +183,10 @@ describe('Content Layer', () => {
it('Returns data entry by id', async () => {
assert.ok(json.hasOwnProperty('dataEntry'));
assert.ok(
json.dataEntry.filePath?.endsWith(
'packages/astro/test/fixtures/content-layer/src/data/dogs.json'
)
json.dataEntry.filePath
?.split(sep)
.join(posixSep)
.endsWith('packages/astro/test/fixtures/content-layer/src/data/dogs.json')
);
delete json.dataEntry.filePath;
assert.deepEqual(json.dataEntry, {
Expand Down

0 comments on commit 3b77d4c

Please sign in to comment.