Add app tests to yarn test

This commit is contained in:
Thomas Nordquist
2020-04-20 12:31:57 +02:00
parent b72fc48bdb
commit ff00f7a99e
3 changed files with 8 additions and 5 deletions

View File

@@ -1,6 +1,8 @@
{
"language": "en",
"words": [
"Bbreak",
"nodered",
"goog",
"thomasnordquist",
"nowrap",

View File

@@ -16,7 +16,7 @@ export class ConfigMigrator {
public applyMigrations(subject: MigrationSubject): Partial<MigrationSubject> {
while (this.isMigrationNecessary(subject)) {
subject = this.applyableMigrations(subject)
subject = this.applicableMigrations(subject)
.filter(migration => migration.from === subject.configVersion)
.reduce((currentSubject, migration) => migration.apply(currentSubject as any), subject)
}
@@ -25,10 +25,10 @@ export class ConfigMigrator {
}
public isMigrationNecessary(subject: MigrationSubject): boolean {
return this.applyableMigrations(subject).length > 0
return this.applicableMigrations(subject).length > 0
}
private applyableMigrations(subject: MigrationSubject): Migration[] {
private applicableMigrations(subject: MigrationSubject): Migration[] {
return this.migrations.filter(migration => migration.from === subject.configVersion)
}
}

View File

@@ -5,7 +5,9 @@
"main": "dist/src/electron.js",
"scripts": {
"start": "electron .",
"test": "yarn run test-backend",
"test": "yarn test:app && yarn test:backend",
"test:app": "cd app && yarn test",
"test:backend": "cd backend && yarn test",
"install": "cd app && yarn && cd ..",
"dev": "npm-run-all --parallel dev:*",
"dev:app": "cd app && npm run dev",
@@ -15,7 +17,6 @@
"lint:tslint": "tslint -p ./",
"lint:spellcheck": "cspell -e ./build -e \"node_modules\" \"**/*.ts{x,}\"",
"build": "tsc && cd app && yarn run build && cd ..",
"test-backend": "cd backend && yarn run test && cd ..",
"prepare-release": "ts-node scripts/prepare-release.ts",
"package": "ts-node package.ts",
"ui-test": "./scripts/uiTests.sh",