Skip to content

Commit

Permalink
test: reorganise folders
Browse files Browse the repository at this point in the history
  • Loading branch information
paulrobertlloyd committed Nov 6, 2023
1 parent fc39d61 commit 5a420fc
Show file tree
Hide file tree
Showing 8 changed files with 6 additions and 5 deletions.
5 changes: 3 additions & 2 deletions tests/helpers/fixture.js → helpers/fixture.js
Original file line number Diff line number Diff line change
@@ -1,13 +1,14 @@
import fs from "node:fs";
import path from "node:path";
import { __dirname } from "../../index.js";
import { __dirname } from "../index.js";

/**
* @param {string} filename Fixture’s file name
* @param {string} encoding String encoding
* @returns {Promise|object} File contents
*/
export const getFixture = (filename, encoding = "utf8") => {
const file = path.resolve(__dirname, `tests/fixtures/${filename}`);
const file = path.resolve(__dirname, `helpers/fixtures/${filename}`);
console.log('file', file)
return fs.readFileSync(file, { encoding });
};
File renamed without changes.
File renamed without changes.
File renamed without changes.
2 changes: 1 addition & 1 deletion tests/fetch-mf2.test.js → test/fetch-mf2.js
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ import { strict as assert } from "node:assert";
import test from "node:test";
import { setGlobalDispatcher } from "undici";
import { fetchMf2 } from "../lib/fetch-mf2.js";
import { mockAgent } from "./helpers/mock-agent.js";
import { mockAgent } from "../helpers/mock-agent.js";

setGlobalDispatcher(mockAgent());

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ import { strict as assert } from "node:assert";
import test from "node:test";
import { setGlobalDispatcher } from "undici";
import { fetchReferences } from "../lib/fetch-references.js";
import { mockAgent } from "./helpers/mock-agent.js";
import { mockAgent } from "../helpers/mock-agent.js";

setGlobalDispatcher(mockAgent());

Expand Down
2 changes: 1 addition & 1 deletion tests/index.test.js → test/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ import { strict as assert } from "node:assert";
import test from "node:test";
import { setGlobalDispatcher } from "undici";
import { mf2tojf2, mf2tojf2referenced } from "../index.js";
import { mockAgent } from "./helpers/mock-agent.js";
import { mockAgent } from "../helpers/mock-agent.js";

setGlobalDispatcher(mockAgent());

Expand Down
File renamed without changes.

0 comments on commit 5a420fc

Please sign in to comment.