|
Last change
on this file was 9af201e, checked in by MBK <marija.karapandzova@…>, 12 days ago |
|
Fix frontend appearance
|
-
Property mode
set to
100644
|
|
File size:
753 bytes
|
| Line | |
|---|
| 1 | import { createMatchPathAsync } from "../match-path-async";
|
|---|
| 2 | import * as Tests from "./data/match-path-data";
|
|---|
| 3 |
|
|---|
| 4 | describe("match-path-async", () => {
|
|---|
| 5 | Tests.tests.forEach((t) =>
|
|---|
| 6 | it(t.name, (done) => {
|
|---|
| 7 | const matchPath = createMatchPathAsync(
|
|---|
| 8 | t.absoluteBaseUrl,
|
|---|
| 9 | t.paths,
|
|---|
| 10 | t.mainFields,
|
|---|
| 11 | t.addMatchAll
|
|---|
| 12 | );
|
|---|
| 13 | matchPath(
|
|---|
| 14 | t.requestedModule,
|
|---|
| 15 | (_path, callback) => callback(undefined, t.packageJson),
|
|---|
| 16 | (path, callback) =>
|
|---|
| 17 | callback(undefined, t.existingFiles.indexOf(path) !== -1),
|
|---|
| 18 | t.extensions,
|
|---|
| 19 | (_err, result) => {
|
|---|
| 20 | // assert.equal(result, t.expectedPath);
|
|---|
| 21 | expect(result).toBe(t.expectedPath);
|
|---|
| 22 | done();
|
|---|
| 23 | }
|
|---|
| 24 | );
|
|---|
| 25 | })
|
|---|
| 26 | );
|
|---|
| 27 | });
|
|---|
Note:
See
TracBrowser
for help on using the repository browser.