mirror of
https://github.com/softprops/action-gh-release.git
synced 2025-05-10 02:44:19 +00:00
prettier
This commit is contained in:
parent
624fcca9a1
commit
ef96a2eb52
7 changed files with 158 additions and 102 deletions
|
@ -1,30 +1,25 @@
|
|||
//import * as assert from "assert";
|
||||
//const assert = require('assert');
|
||||
import * as assert from 'assert';
|
||||
import { mimeOrDefault, asset } from '../src/github';
|
||||
import * as assert from "assert";
|
||||
import { mimeOrDefault, asset } from "../src/github";
|
||||
|
||||
describe('github', () => {
|
||||
describe('mimeOrDefault', () => {
|
||||
it('returns a specific mime for common path', async () => {
|
||||
assert.equal(mimeOrDefault('foo.tar.gz'), 'application/gzip')
|
||||
});
|
||||
it('returns default mime for uncommon path', async () => {
|
||||
assert.equal(mimeOrDefault('foo.uncommon'), 'application/octet-stream')
|
||||
});
|
||||
});
|
||||
describe("github", () => {
|
||||
describe("mimeOrDefault", () => {
|
||||
it("returns a specific mime for common path", async () => {
|
||||
assert.equal(mimeOrDefault("foo.tar.gz"), "application/gzip");
|
||||
});
|
||||
it("returns default mime for uncommon path", async () => {
|
||||
assert.equal(mimeOrDefault("foo.uncommon"), "application/octet-stream");
|
||||
});
|
||||
});
|
||||
|
||||
describe('asset', () => {
|
||||
it('derives asset info from a path', async () => {
|
||||
const {
|
||||
name,
|
||||
mime,
|
||||
size,
|
||||
file
|
||||
} = asset('tests/data/foo/bar.txt');
|
||||
assert.equal(name, 'bar.txt');
|
||||
assert.equal(mime, 'text/plain');
|
||||
assert.equal(size, 10);
|
||||
assert.equal(file.toString(), 'release me')
|
||||
});
|
||||
})
|
||||
});
|
||||
describe("asset", () => {
|
||||
it("derives asset info from a path", async () => {
|
||||
const { name, mime, size, file } = asset("tests/data/foo/bar.txt");
|
||||
assert.equal(name, "bar.txt");
|
||||
assert.equal(mime, "text/plain");
|
||||
assert.equal(size, 10);
|
||||
assert.equal(file.toString(), "release me");
|
||||
});
|
||||
});
|
||||
});
|
||||
|
|
|
@ -1,19 +1,21 @@
|
|||
import { isTag, paths } from '../src/util';
|
||||
import * as assert from 'assert';
|
||||
import { isTag, paths } from "../src/util";
|
||||
import * as assert from "assert";
|
||||
|
||||
describe('util', () => {
|
||||
describe('isTag', () => {
|
||||
it('returns true for tags', async () => {
|
||||
assert.equal(isTag('refs/tags/foo'), true)
|
||||
describe("util", () => {
|
||||
describe("isTag", () => {
|
||||
it("returns true for tags", async () => {
|
||||
assert.equal(isTag("refs/tags/foo"), true);
|
||||
});
|
||||
it ('returns false for other kinds of refs', async () => {
|
||||
assert.equal(isTag('refs/heads/master'), false)
|
||||
})
|
||||
})
|
||||
it("returns false for other kinds of refs", async () => {
|
||||
assert.equal(isTag("refs/heads/master"), false);
|
||||
});
|
||||
});
|
||||
|
||||
describe('paths', () => {
|
||||
it('resolves files given a set of paths', async () => {
|
||||
assert.deepStrictEqual(paths(["tests/data/**/*"]), ['tests/data/foo/bar.txt'])
|
||||
describe("paths", () => {
|
||||
it("resolves files given a set of paths", async () => {
|
||||
assert.deepStrictEqual(paths(["tests/data/**/*"]), [
|
||||
"tests/data/foo/bar.txt"
|
||||
]);
|
||||
});
|
||||
})
|
||||
});
|
||||
});
|
||||
});
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue