Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
136 changes: 68 additions & 68 deletions package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

23 changes: 23 additions & 0 deletions src/lib/core/index.test.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
import { describe, expect, test } from "vitest";

describe('index', () => {
test("Should export exactly the expected objects.", async () => {
// Arrange.
const expectedList = [
'location',
'RouterEngine',
'joinPaths',
];

// Act.
const lib = await import('./index.js');

// Assert.
for (let item of expectedList) {
expect(item in lib, `The expected object ${item} is not exported.`).toEqual(true);
}
for (let key of Object.keys(lib)) {
expect(expectedList.includes(key), `The library exports object ${key}, which is not expected.`).toEqual(true);
}
});
});
2 changes: 1 addition & 1 deletion src/lib/core/index.ts
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
export { location } from "./Location.js";
export { RouterEngine as Router, joinPaths } from "./RouterEngine.svelte.js";
export { RouterEngine, joinPaths } from "./RouterEngine.svelte.js";
30 changes: 30 additions & 0 deletions src/lib/index.test.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,30 @@
import { describe, expect, test } from "vitest";

describe('index', () => {
test("Should export exactly the expected objects.", async () => {
// Arrange.
const expectedList = [
'Link',
'LinkContext',
'Route',
'Router',
'Fallback',
'location',
'RouterTrace',
'init',
'getRouterContext',
'setRouterContext',
];

// Act.
const lib = await import('./index.js');

// Assert.
for (let item of expectedList) {
expect(item in lib, `The expected object ${item} is not exported.`).toEqual(true);
}
for (let key of Object.keys(lib)) {
expect(expectedList.includes(key), `The library exports object ${key}, which is not expected.`).toEqual(true);
}
});
});