2019-09-09 21:20:59 +09:00
|
|
|
import { isTag, paths } from "../src/util";
|
|
|
|
import * as assert from "assert";
|
2019-09-09 17:10:07 +09:00
|
|
|
|
2019-09-09 21:20:59 +09:00
|
|
|
describe("util", () => {
|
|
|
|
describe("isTag", () => {
|
|
|
|
it("returns true for tags", async () => {
|
|
|
|
assert.equal(isTag("refs/tags/foo"), true);
|
2019-09-09 17:10:07 +09:00
|
|
|
});
|
2019-09-09 21:20:59 +09:00
|
|
|
it("returns false for other kinds of refs", async () => {
|
|
|
|
assert.equal(isTag("refs/heads/master"), false);
|
|
|
|
});
|
|
|
|
});
|
2019-09-09 17:10:07 +09:00
|
|
|
|
2019-09-09 21:20:59 +09:00
|
|
|
describe("paths", () => {
|
|
|
|
it("resolves files given a set of paths", async () => {
|
|
|
|
assert.deepStrictEqual(paths(["tests/data/**/*"]), [
|
|
|
|
"tests/data/foo/bar.txt"
|
|
|
|
]);
|
2019-09-09 17:10:07 +09:00
|
|
|
});
|
2019-09-09 21:20:59 +09:00
|
|
|
});
|
|
|
|
});
|