mirror of
https://github.com/joelwmale/webhook-action.git
synced 2024-08-25 08:08:00 +00:00
1ada95e04a
- Convert project to Javascript/Typescript - Allow custom headers to be passed in (optional) - Allow body to be optional
28 lines
734 B
TypeScript
28 lines
734 B
TypeScript
import { assert } from "chai";
|
|
import { createMatchPathAsync } from "../src/match-path-async";
|
|
import * as Tests from "./data/match-path-data";
|
|
|
|
describe("match-path-async", () => {
|
|
Tests.tests.forEach(t =>
|
|
it(t.name, done => {
|
|
const matchPath = createMatchPathAsync(
|
|
t.absoluteBaseUrl,
|
|
t.paths,
|
|
t.mainFields,
|
|
t.addMatchAll
|
|
);
|
|
matchPath(
|
|
t.requestedModule,
|
|
(_path, callback) => callback(undefined, t.packageJson),
|
|
(path, callback) =>
|
|
callback(undefined, t.existingFiles.indexOf(path) !== -1),
|
|
t.extensions,
|
|
(_err, result) => {
|
|
assert.equal(result, t.expectedPath);
|
|
done();
|
|
}
|
|
);
|
|
})
|
|
);
|
|
});
|