create-yoshi-app
Advanced tools
Comparing version 3.22.5 to 3.24.0
{ | ||
"name": "create-yoshi-app", | ||
"version": "3.22.5", | ||
"version": "3.24.0", | ||
"description": "create yoshi powered apps", | ||
@@ -5,0 +5,0 @@ "keywords": [ |
@@ -26,3 +26,3 @@ #!/usr/bin/env node | ||
const mocha = new Mocha({ | ||
timeout: 180000, | ||
timeout: 200000, | ||
reporter: process.env.TEAMCITY_VERSION ? 'mocha-teamcity-reporter' : 'spec', | ||
@@ -29,0 +29,0 @@ }); |
@@ -1,3 +0,20 @@ | ||
require('../environment') | ||
const testKitEnv = require('../environment') | ||
.environment() | ||
.then(env => env.start()); | ||
.then(env => { | ||
env.start(); | ||
return env; | ||
}); | ||
// We need to stop the testkit explicitly, since it's running in a different process | ||
const stopTestKit = () => testKitEnv.then(tk => tk.stop()); | ||
const signals: ('SIGINT' | 'SIGUSR1' | 'SIGUSR2')[] = [ | ||
'SIGINT', | ||
'SIGUSR1', | ||
'SIGUSR2', | ||
]; | ||
signals.forEach(ev => process.on(ev, stopTestKit)); | ||
process.on('uncaughtException', stopTestKit); | ||
process.on('exit', stopTestKit); |
@@ -1,11 +0,6 @@ | ||
import { browser, ElementFinder, ExpectedConditions, $ } from 'protractor'; | ||
const chance = require('chance'); | ||
export const appDriver = env => { | ||
const waitForVisibilityOf = async ( | ||
element: ElementFinder, | ||
timeout: number = 4000, | ||
) => { | ||
await browser.wait(ExpectedConditions.visibilityOf(element), timeout); | ||
return element; | ||
export const appDriver = () => { | ||
const waitForVisibilityOf = async (selector: string) => { | ||
return page.waitForSelector(selector); | ||
}; | ||
@@ -17,12 +12,12 @@ | ||
const metaSiteId = changeInstance.guid(); | ||
await browser.get( | ||
await env.businessManager.getUrl(`${metaSiteId}/{%projectName%}`), | ||
await page.goto( | ||
await testKitEnv.getUrl(`${metaSiteId}/{%projectName%}`), | ||
); | ||
}, | ||
getAppTitleText: async () => { | ||
return waitForVisibilityOf($('[data-hook="app-title"]')).then(e => | ||
e.getText(), | ||
); | ||
await waitForVisibilityOf('h2'); | ||
return page.$eval('h2', e => e.innerText); | ||
}, | ||
waitForSelector: waitForVisibilityOf, | ||
}; | ||
}; |
@@ -7,3 +7,9 @@ import { | ||
const getTestkitConfig = async () => { | ||
interface TestKitConfigOptions { | ||
withRandomPorts: boolean; | ||
} | ||
const getTestKitConfig = async ( | ||
{ withRandomPorts }: TestKitConfigOptions = { withRandomPorts: false }, | ||
) => { | ||
const serverUrl = 'http://localhost:3200/'; | ||
@@ -17,15 +23,14 @@ const path = './templates/module_{%PROJECT_NAME%}.json.erb'; | ||
return testkitConfigBuilder() | ||
let builder = testkitConfigBuilder() | ||
.withModulesConfig(moduleConfig) | ||
.autoLogin() | ||
.build(); | ||
.autoLogin(); | ||
if (withRandomPorts) { | ||
builder = builder.withRandomPorts(); | ||
} | ||
return builder.build(); | ||
}; | ||
export const environment = async () => { | ||
const testkit = createTestkit(await getTestkitConfig()); | ||
return { | ||
start: () => testkit.start(), | ||
stop: () => testkit.stop(), | ||
businessManager: testkit, | ||
}; | ||
}; | ||
export const environment = async envConfig => | ||
createTestkit(await getTestKitConfig(envConfig)); |
{ | ||
"compilerOptions": { | ||
"allowSyntheticDefaultImports": true, | ||
"outDir": "./dist/", | ||
"sourceMap": true, | ||
@@ -7,5 +9,4 @@ "noImplicitAny": false, | ||
"moduleResolution": "node", | ||
"importHelpers": true, | ||
"target": "es5", | ||
"noUnusedLocals": true, | ||
"importHelpers": true, | ||
"jsx": "react", | ||
@@ -15,8 +16,9 @@ "lib": ["dom", "es2016"] | ||
"include": [ | ||
"src/**/*.*", | ||
"test/**/*.*" | ||
"./test/**/*.ts", | ||
"./src/**/*.spec.tsx" | ||
], | ||
"files": [ | ||
"./node_modules/jest-yoshi-preset/types.d.ts", | ||
"./src/external-types.d.ts" | ||
] | ||
} |
@@ -1,1 +0,1 @@ | ||
module.exports = require('yoshi/config/wallaby-mocha'); | ||
module.exports = require('yoshi/config/wallaby-jest'); |
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
203164
419
4612