* config(jest): updated setup * config(jest): update testMatch to include jsx files * config(jest): add transformIgnorePatterns * config(jest): update ignore files that do not work in jest yet * config: add test:unit-jest to test script * fix(jest): lint with eslint-plugin-jest * refactor(jest): move unit test directory * refactor(mocha): restore mocha tests that fail in jest * docs(jest): update helpful scripts with test:unit-jest
27 lines
597 B
JavaScript
27 lines
597 B
JavaScript
|
|
import { downloadConfig } from "corePlugins/configs/spec-actions"
|
|
|
|
describe("configs plugin - actions", () => {
|
|
|
|
describe("downloadConfig", () => {
|
|
it("should call the system fetch helper with a provided request", () => {
|
|
const fetchSpy = jest.fn(async () => {})
|
|
const system = {
|
|
fn: {
|
|
fetch: fetchSpy
|
|
}
|
|
}
|
|
|
|
const req = {
|
|
url: "http://swagger.io/one",
|
|
requestInterceptor: a => a,
|
|
responseInterceptor: a => a,
|
|
}
|
|
|
|
downloadConfig(req)(system)
|
|
|
|
expect(fetchSpy).toHaveBeenCalledWith(req)
|
|
})
|
|
})
|
|
})
|