mirror of
https://github.com/actions/labeler.git
synced 2025-12-12 12:37:48 +00:00
Add .prettierrc.json to configure Prettier, reformat code
This commit is contained in:
@@ -1,27 +1,27 @@
|
||||
import { checkGlobs } from "../src/labeler";
|
||||
import {checkGlobs} from '../src/labeler';
|
||||
|
||||
import * as core from "@actions/core";
|
||||
import * as core from '@actions/core';
|
||||
|
||||
jest.mock("@actions/core");
|
||||
jest.mock('@actions/core');
|
||||
|
||||
beforeAll(() => {
|
||||
jest.spyOn(core, "getInput").mockImplementation((name, options) => {
|
||||
return jest.requireActual("@actions/core").getInput(name, options);
|
||||
jest.spyOn(core, 'getInput').mockImplementation((name, options) => {
|
||||
return jest.requireActual('@actions/core').getInput(name, options);
|
||||
});
|
||||
});
|
||||
|
||||
const matchConfig = [{ any: ["*.txt"] }];
|
||||
const matchConfig = [{any: ['*.txt']}];
|
||||
|
||||
describe("checkGlobs", () => {
|
||||
it("returns true when our pattern does match changed files", () => {
|
||||
const changedFiles = ["foo.txt", "bar.txt"];
|
||||
describe('checkGlobs', () => {
|
||||
it('returns true when our pattern does match changed files', () => {
|
||||
const changedFiles = ['foo.txt', 'bar.txt'];
|
||||
const result = checkGlobs(changedFiles, matchConfig);
|
||||
|
||||
expect(result).toBeTruthy();
|
||||
});
|
||||
|
||||
it("returns false when our pattern does not match changed files", () => {
|
||||
const changedFiles = ["foo.docx"];
|
||||
it('returns false when our pattern does not match changed files', () => {
|
||||
const changedFiles = ['foo.docx'];
|
||||
const result = checkGlobs(changedFiles, matchConfig);
|
||||
|
||||
expect(result).toBeFalsy();
|
||||
|
||||
Reference in New Issue
Block a user