@adonisjs/assembler 5.5.2-0 → 5.5.3-0

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.
@@ -0,0 +1,69 @@
1
+ /**
2
+ * File source: https://bit.ly/3ukaHTz
3
+ *
4
+ * Feel free to let us know via PR, if you find something broken in this contract
5
+ * file.
6
+ */
7
+
8
+ import type { Config } from '@japa/runner'
9
+ import TestUtils from '@ioc:Adonis/Core/TestUtils'
10
+ import { assert, runFailedTests, specReporter, apiClient } from '@japa/preset-adonis'
11
+
12
+ /*
13
+ |--------------------------------------------------------------------------
14
+ | Japa Plugins
15
+ |--------------------------------------------------------------------------
16
+ |
17
+ | Japa plugins allows you to add additional features to Japa. By default
18
+ | we register the assertion plugin.
19
+ |
20
+ | Feel free to remove existing plugins or add more.
21
+ |
22
+ */
23
+ export const plugins: Config['plugins'] = [assert(), runFailedTests(), apiClient()]
24
+
25
+ /*
26
+ |--------------------------------------------------------------------------
27
+ | Japa Reporters
28
+ |--------------------------------------------------------------------------
29
+ |
30
+ | Japa reporters displays/saves the progress of tests as they are executed.
31
+ | By default, we register the spec reporter to show a detailed report
32
+ | of tests on the terminal.
33
+ |
34
+ */
35
+ export const reporters: Config['reporters'] = [specReporter()]
36
+
37
+ /*
38
+ |--------------------------------------------------------------------------
39
+ | Runner hooks
40
+ |--------------------------------------------------------------------------
41
+ |
42
+ | Runner hooks are executed after booting the AdonisJS app and
43
+ | before the test files are imported.
44
+ |
45
+ | You can perform actions like starting the HTTP server or running migrations
46
+ | within the runner hooks
47
+ |
48
+ */
49
+ export const runnerHooks: Required<Pick<Config, 'setup' | 'teardown'>> = {
50
+ setup: [() => TestUtils.ace().loadCommands()],
51
+ teardown: [],
52
+ }
53
+
54
+ /*
55
+ |--------------------------------------------------------------------------
56
+ | Configure individual suites
57
+ |--------------------------------------------------------------------------
58
+ |
59
+ | The configureSuite method gets called for every test suite registered
60
+ | within ".adonisrc.json" file.
61
+ |
62
+ | You can use this method to configure suites. For example: Only start
63
+ | the HTTP server when it is a functional suite.
64
+ */
65
+ export const configureSuite: Config['configureSuite'] = (suite) => {
66
+ if (suite.name === 'functional') {
67
+ suite.setup(() => TestUtils.httpServer().start())
68
+ }
69
+ }
@@ -0,0 +1,8 @@
1
+ import { test } from '@japa/runner'
2
+
3
+ test('display welcome page', async ({ client }) => {
4
+ const response = await client.get('/')
5
+
6
+ response.assertStatus(200)
7
+ response.assertTextIncludes('<h1 class="title"> It Works! </h1>')
8
+ })
@@ -1,5 +1,5 @@
1
1
  /**
2
- * Contract source: https://github.com/adonisjs/core/blob/master/templates/contracts/tests.txt
2
+ * Contract source: https://bit.ly/3DP1ypf
3
3
  *
4
4
  * Feel free to let us know via PR, if you find something broken in this contract
5
5
  * file.
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@adonisjs/assembler",
3
- "version": "5.5.2-0",
3
+ "version": "5.5.3-0",
4
4
  "description": "Core commands to compiler and build AdonisJs project",
5
5
  "main": "build/ace-manifest.json",
6
6
  "files": [
@@ -19,7 +19,7 @@
19
19
  "lint": "eslint . --ext=.ts",
20
20
  "clean": "del build",
21
21
  "compile": "npm run lint && npm run clean && tsc",
22
- "build": "npm run compile && node build/bin/index.js && copyfiles \"templates/*\" build",
22
+ "build": "npm run compile && node build/bin/index.js && copyfiles \"templates/**\" build",
23
23
  "commit": "git-cz",
24
24
  "release": "np --message=\"chore(release): %s\"",
25
25
  "version": "npm run build",