housekeeping: reorganize and rewire Mocha tests (#5600)
* move Mocha-run tests to `test/mocha` * fix relative paths * fix JSX test paths * update stagnated JSX tests * `test/setup.js` -> `test/mocha/setup.js` * use regex+globstar for test matching * remove `console.log`
This commit is contained in:
27
test/mocha/core/plugins/configs/actions.js
Normal file
27
test/mocha/core/plugins/configs/actions.js
Normal file
@@ -0,0 +1,27 @@
|
||||
/* eslint-env mocha */
|
||||
import expect, { createSpy } from "expect"
|
||||
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 = createSpy(async () => {}).andCallThrough()
|
||||
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)
|
||||
})
|
||||
})
|
||||
})
|
||||
Reference in New Issue
Block a user