match-path-async.test.js 942 B

12345678910111213141516171819
  1. "use strict";
  2. Object.defineProperty(exports, "__esModule", { value: true });
  3. var match_path_async_1 = require("../match-path-async");
  4. var Tests = require("./data/match-path-data");
  5. describe("match-path-async", function () {
  6. Tests.tests.forEach(function (t) {
  7. return it(t.name, function (done) {
  8. var matchPath = (0, match_path_async_1.createMatchPathAsync)(t.absoluteBaseUrl, t.paths, t.mainFields, t.addMatchAll);
  9. matchPath(t.requestedModule, function (_path, callback) { return callback(undefined, t.packageJson); }, function (path, callback) {
  10. return callback(undefined, t.existingFiles.indexOf(path) !== -1);
  11. }, t.extensions, function (_err, result) {
  12. // assert.equal(result, t.expectedPath);
  13. expect(result).toBe(t.expectedPath);
  14. done();
  15. });
  16. });
  17. });
  18. });
  19. //# sourceMappingURL=match-path-async.test.js.map