-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
- Loading branch information
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,6 +1,6 @@ | ||
import { BaseError } from "make-error"; | ||
export default class ConflictingItemError extends BaseError { | ||
readonly itemName: string; | ||
readonly itemId: string; | ||
constructor(itemName: string, itemId: string); | ||
readonly itemId?: string; | ||
constructor(itemName: string, itemId?: string); | ||
} |
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,6 +1,6 @@ | ||
import { BaseError } from "make-error"; | ||
export default class ItemNotFoundError extends BaseError { | ||
readonly itemName: string; | ||
readonly itemId: string; | ||
constructor(itemName: string, itemId: string); | ||
readonly itemId?: string; | ||
constructor(itemName: string, itemId?: string); | ||
} |
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,4 +1,4 @@ | ||
import Options from "../../interfaces/Options"; | ||
import { TestItem } from "../utils/testItem"; | ||
import Options from '../../interfaces/Options'; | ||
import { TestItem } from '../utils/testItem'; | ||
declare const _default: ({ facade }: Options<TestItem>) => void; | ||
export default _default; |
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,4 +1,4 @@ | ||
import { TestItem } from "./functions/utils/testItem"; | ||
import Options from "./interfaces/Options"; | ||
import { TestItem } from './functions/utils/testItem'; | ||
import Options from './interfaces/Options'; | ||
declare const _default: (options: Options<TestItem>) => void; | ||
export default _default; |
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,31 +1,34 @@ | ||
import Options from "../../interfaces/Options"; | ||
import { TestItem } from "../utils/testItem"; | ||
import testUsingFilter from "../utils/testUsingFilter"; | ||
// tslint:disable:no-any | ||
import Options from '../../interfaces/Options'; | ||
import { TestItem } from '../utils/testItem'; | ||
import testUsingFilter from '../utils/testUsingFilter'; | ||
|
||
export default ({ facade }: Options<TestItem>) => { | ||
describe("countItems", () => { | ||
testUsingFilter({ | ||
facade, | ||
toGetAllItems: async filter => { | ||
const { count } = await facade.countItems({ filter }); | ||
const expectedCount = 2; | ||
expect(count).toBe(expectedCount); | ||
}, | ||
toGetFirstItem: async filter => { | ||
const { count } = await facade.countItems({ filter }); | ||
const expectedCount = 1; | ||
expect(count).toBe(expectedCount); | ||
}, | ||
toGetNoItems: async filter => { | ||
const { count } = await facade.countItems({ filter }); | ||
const expectedCount = 0; | ||
expect(count).toBe(expectedCount); | ||
}, | ||
toGetSecondItem: async filter => { | ||
const { count } = await facade.countItems({ filter }); | ||
const expectedCount = 1; | ||
expect(count).toBe(expectedCount); | ||
} | ||
if (facade.countItems !== undefined) { | ||
describe('countItems', () => { | ||
testUsingFilter({ | ||
facade, | ||
toGetAllItems: async filter => { | ||
const { count } = await (facade as any).countItems({ filter }); | ||
const expectedCount = 2; | ||
expect(count).toBe(expectedCount); | ||
}, | ||
toGetFirstItem: async filter => { | ||
const { count } = await (facade as any).countItems({ filter }); | ||
const expectedCount = 1; | ||
expect(count).toBe(expectedCount); | ||
}, | ||
toGetNoItems: async filter => { | ||
const { count } = await (facade as any).countItems({ filter }); | ||
const expectedCount = 0; | ||
expect(count).toBe(expectedCount); | ||
}, | ||
toGetSecondItem: async filter => { | ||
const { count } = await (facade as any).countItems({ filter }); | ||
const expectedCount = 1; | ||
expect(count).toBe(expectedCount); | ||
}, | ||
}); | ||
}); | ||
}); | ||
} | ||
}; |