generated from AthennaIO/Template
-
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #186 from AthennaIO/develop
fix(base): use right url path
- Loading branch information
Showing
15 changed files
with
136 additions
and
30 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,6 +1,6 @@ | ||
{ | ||
"name": "@athenna/core", | ||
"version": "4.5.0", | ||
"version": "4.6.0", | ||
"description": "The plug and play Node.js framework.", | ||
"license": "MIT", | ||
"author": "João Lenon <[email protected]>", | ||
|
@@ -70,8 +70,8 @@ | |
"semver": "^7.5.4" | ||
}, | ||
"devDependencies": { | ||
"@athenna/artisan": "^4.2.0", | ||
"@athenna/common": "^4.4.0", | ||
"@athenna/artisan": "^4.8.0", | ||
"@athenna/common": "^4.9.2", | ||
"@athenna/config": "^4.3.0", | ||
"@athenna/http": "^4.4.0", | ||
"@athenna/ioc": "^4.1.0", | ||
|
@@ -204,7 +204,9 @@ | |
"provider": "./templates/provider.edge", | ||
"service": "./templates/service.edge", | ||
"test": "./templates/test.edge", | ||
"testFn": "./templates/testFn.edge", | ||
"test-cli": "./templates/test-cli.edge", | ||
"test-rest": "./templates/test-rest.edge", | ||
"test-fn": "./templates/test-fn.edge", | ||
"command": "node_modules/@athenna/artisan/templates/command.edge", | ||
"controller": "node_modules/@athenna/http/templates/controller.edge", | ||
"middleware": "node_modules/@athenna/http/templates/middleware.edge", | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,12 @@ | ||
import { Test, type Context } from '@athenna/test' | ||
import { BaseCliTest } from '@athenna/core/testing/BaseCliTest' | ||
|
||
export default class {{ namePascal }} extends BaseCliTest { | ||
@Test() | ||
public async shouldBeAbleToExecuteCliCommands({ command }: Context) { | ||
const output = await command.run('greet') | ||
|
||
output.assertSucceeded() | ||
output.assertLogged('Hello World!') | ||
} | ||
} |
File renamed without changes.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,11 @@ | ||
import { Test, type Context } from '@athenna/test' | ||
import { BaseRestTest } from '@athenna/core/testing/BaseRestTest' | ||
|
||
export default class {{ namePascal }} extends BaseRestTest { | ||
@Test() | ||
public async shouldBeAbleToExecuteRestApiRequests({ request }: Context) { | ||
const response = await request.get('/') | ||
|
||
response.assertStatusCode(200) | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,23 @@ | ||
/** | ||
* @athenna/core | ||
* | ||
* (c) João Lenon <[email protected]> | ||
* | ||
* For the full copyright and license information, please view the LICENSE | ||
* file that was distributed with this source code. | ||
*/ | ||
|
||
import { BaseCommand, Argument } from '@athenna/artisan' | ||
|
||
export class GreetCommand extends BaseCommand { | ||
@Argument() | ||
public name: string | ||
|
||
public static signature(): string { | ||
return 'greet' | ||
} | ||
|
||
public async handle(): Promise<void> { | ||
this.logger.simple(`({bold,green} [ HELLO ${this.name.toUpperCase()}! ])\n`) | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,16 @@ | ||
import { ArtisanProvider } from '@athenna/artisan' | ||
import { Test, type Context } from '@athenna/test' | ||
import { BaseCliTest as InternalBaseCliTest } from '@athenna/core/testing/BaseCliTest' | ||
|
||
export default class BaseCliTest extends InternalBaseCliTest { | ||
public artisanPath = Path.bin('artisan.ts') | ||
|
||
@Test() | ||
public async shouldBeAbleToRunTestsExtendingBaseCliTestClass({ command }: Context) { | ||
new ArtisanProvider().register() | ||
const output = await command.run('greet lenon') | ||
|
||
output.assertSucceeded() | ||
output.assertLogged('HELLO LENON!') | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,17 @@ | ||
import { Test, type Context } from '@athenna/test' | ||
import { BaseRestTest as InternalBaseRestTest } from '@athenna/core/testing/BaseRestTest' | ||
import type { HttpOptions } from '#src/index' | ||
|
||
export default class BaseRestTest extends InternalBaseRestTest { | ||
public restOptions: HttpOptions = { | ||
routePath: Path.stubs('routes/http.ts'), | ||
} | ||
|
||
@Test() | ||
public async shouldBeAbleToRunTestsExtendingBaseRestTestClass({ request }: Context) { | ||
const response = await request.get('/hello') | ||
|
||
response.assertStatusCode(200) | ||
response.assertBodyContains({ ok: true }) | ||
} | ||
} |