velocious 1.0.61 → 1.0.62

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/package.json CHANGED
@@ -3,7 +3,7 @@
3
3
  "velocious": "bin/velocious.js"
4
4
  },
5
5
  "name": "velocious",
6
- "version": "1.0.61",
6
+ "version": "1.0.62",
7
7
  "main": "index.js",
8
8
  "scripts": {
9
9
  "test": "VELOCIOUS_TEST_DIR=../ cd spec/dummy && npx velocious test",
@@ -22,6 +22,9 @@ export default class VelociousCliCommandsTest extends BaseCommand {
22
22
  if (testRunner.isFailed()) {
23
23
  console.error(`\nTest run failed with ${testRunner.getFailedTests()} failed tests and ${testRunner.getSuccessfulTests()} successfull`)
24
24
  process.exit(1)
25
+ } else if (testRunner.areAnyTestsFocussed()) {
26
+ console.error(`\nFocussed run with ${testRunner.getFailedTests()} failed tests and ${testRunner.getSuccessfulTests()} successfull`)
27
+ process.exit(1)
25
28
  } else {
26
29
  console.log(`\nTest run succeeded with ${testRunner.getSuccessfulTests()} successful tests`)
27
30
  process.exit(0)
@@ -27,6 +27,11 @@ export default class VelociousDatabaseMigration {
27
27
  }
28
28
 
29
29
  getDriver() { return this._db }
30
+ connection() { return this.getDriver() }
31
+
32
+ async execute(sql) {
33
+ await this.connection().query(sql)
34
+ }
30
35
 
31
36
  async addColumn(tableName, columnName, columnType, args) {
32
37
  if (!columnType) throw new Error("No column type given")
@@ -2,10 +2,10 @@ import Migration from "velocious/src/database/migration/index.js"
2
2
 
3
3
  export default class __MIGRATION_NAME__ extends Migration {
4
4
  async up() {
5
- await this.connection().execute("...")
5
+ await this.execute("...")
6
6
  }
7
7
 
8
8
  async down() {
9
- await this.connection().execute("...")
9
+ await this.execute("...")
10
10
  }
11
11
  }
@@ -62,6 +62,7 @@ export default class TestRunner {
62
62
  }
63
63
 
64
64
  async prepare() {
65
+ this.anyTestsFocussed = false
65
66
  this._failedTests = 0
66
67
  this._successfulTests = 0
67
68
  this._testsCount = 0
@@ -76,6 +77,14 @@ export default class TestRunner {
76
77
  }
77
78
  }
78
79
 
80
+ areAnyTestsFocussed() {
81
+ if (this.anyTestsFocussed === undefined) {
82
+ throw new Error("Hasn't been detected yet")
83
+ }
84
+
85
+ return this.anyTestsFocussed
86
+ }
87
+
79
88
  async run() {
80
89
  await this.configuration.ensureConnections(async () => {
81
90
  await this.runTests({