jest configuration for ui-packages

This commit is contained in:
Sebastian Sdorra
2019-10-09 10:19:46 +02:00
parent 3167b599cd
commit e1390d68c9
9 changed files with 975 additions and 1114 deletions

View File

@@ -12,7 +12,8 @@ import RepositoryConfig from "./RepositoryConfig";
// repository
const gitPredicate = (props: Object) => {
// @visibleForTesting
export const gitPredicate = (props: Object) => {
return props.repository && props.repository.type === "git";
};

View File

@@ -0,0 +1,15 @@
// @flow
import { gitPredicate } from "./index";
describe("test gi predicate", () => {
it("should return false", () => {
expect(gitPredicate()).toBe(false);
expect(gitPredicate({})).toBe(false);
expect(gitPredicate({ repository: {} })).toBe(false);
expect(gitPredicate({ repository: { type: "hg" } })).toBe(false);
});
it("should return true", () => {
expect(gitPredicate({ repository: { type: "fir" } })).toBe(true);
});
});