web 3d图形渲染器
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

27 lines
734 B

  1. import { assert } from "chai";
  2. import { createMatchPathAsync } from "../src/match-path-async";
  3. import * as Tests from "./data/match-path-data";
  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. done();
  22. }
  23. );
  24. })
  25. );
  26. });