Fix automation test
This commit is contained in:
parent
498d1776e0
commit
4ac3102f2a
|
@ -13,4 +13,13 @@ const config: Config.InitialOptions = {
|
||||||
},
|
},
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if (!process.env.CI) {
|
||||||
|
// use sources when not in CI
|
||||||
|
config.moduleNameMapper = {
|
||||||
|
"@budibase/types": "<rootDir>/../types/src",
|
||||||
|
}
|
||||||
|
} else {
|
||||||
|
console.log("Running tests with compiled dependency sources")
|
||||||
|
}
|
||||||
|
|
||||||
export default config
|
export default config
|
||||||
|
|
|
@ -18,4 +18,20 @@ const config: Config.InitialOptions = {
|
||||||
},
|
},
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if (!process.env.CI) {
|
||||||
|
// use sources when not in CI
|
||||||
|
config.moduleNameMapper = {
|
||||||
|
"@budibase/backend-core/(.*)": "<rootDir>/../backend-core/$1",
|
||||||
|
"@budibase/backend-core": "<rootDir>/../backend-core/src",
|
||||||
|
"@budibase/types": "<rootDir>/../types/src",
|
||||||
|
}
|
||||||
|
// add pro sources if they exist
|
||||||
|
if (fs.existsSync("../../../budibase-pro")) {
|
||||||
|
config.moduleNameMapper["@budibase/pro"] =
|
||||||
|
"<rootDir>/../../../budibase-pro/packages/pro/src"
|
||||||
|
}
|
||||||
|
} else {
|
||||||
|
console.log("Running tests with compiled dependency sources")
|
||||||
|
}
|
||||||
|
|
||||||
export default config
|
export default config
|
||||||
|
|
|
@ -29,7 +29,7 @@ describe("Run through some parts of the automations system", () => {
|
||||||
afterAll(setup.afterAll)
|
afterAll(setup.afterAll)
|
||||||
|
|
||||||
it("should be able to init in builder", async () => {
|
it("should be able to init in builder", async () => {
|
||||||
await triggers.externalTrigger(basicAutomation(), { a: 1, appId: "app_123" })
|
await triggers.externalTrigger(basicAutomation(), { a: 1, appId: config.appId })
|
||||||
await wait(100)
|
await wait(100)
|
||||||
expect(thread.execute).toHaveBeenCalled()
|
expect(thread.execute).toHaveBeenCalled()
|
||||||
})
|
})
|
||||||
|
|
|
@ -399,11 +399,11 @@ class TestConfiguration {
|
||||||
// clear any old app
|
// clear any old app
|
||||||
this.appId = null
|
this.appId = null
|
||||||
// @ts-ignore
|
// @ts-ignore
|
||||||
await context.updateAppId(null)
|
context.updateAppId(null)
|
||||||
this.app = await this._req({ name: appName }, null, controllers.app.create)
|
this.app = await this._req({ name: appName }, null, controllers.app.create)
|
||||||
this.appId = this.app.appId
|
this.appId = this.app.appId
|
||||||
// @ts-ignore
|
// @ts-ignore
|
||||||
await context.updateAppId(this.appId)
|
context.updateAppId(this.appId)
|
||||||
|
|
||||||
// create production app
|
// create production app
|
||||||
this.prodApp = await this.publish()
|
this.prodApp = await this.publish()
|
||||||
|
|
Loading…
Reference in New Issue