Skip to content

Commit

Permalink
Merge pull request #12 from AthennaIO/develop
Browse files Browse the repository at this point in the history
chore(npm): update dependencies
  • Loading branch information
jlenon7 authored Sep 5, 2022
2 parents b388fb3 + aec7284 commit a4139c6
Show file tree
Hide file tree
Showing 8 changed files with 1,520 additions and 332 deletions.
1,807 changes: 1,501 additions & 306 deletions package-lock.json

Large diffs are not rendered by default.

5 changes: 2 additions & 3 deletions package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@athenna/test",
"version": "1.1.0",
"version": "1.1.1",
"description": "The Athenna test runner. Built on top of Japa.",
"license": "MIT",
"author": "João Lenon <lenon@athenna.io>",
Expand Down Expand Up @@ -39,7 +39,7 @@
"#tests/*": "./tests/*.js"
},
"dependencies": {
"@athenna/core": "1.7.8",
"@athenna/core": "1.7.9",
"@japa/runner": "2.0.7",
"@japa/assert": "1.3.4",
"@secjs/utils": "1.9.7"
Expand All @@ -61,7 +61,6 @@
"husky": "3.0.9",
"lint-staged": "12.4.1",
"minimist": "1.2.6",
"nodemon": "^2.0.19",
"prettier": "2.6.2",
"rimraf": "3.0.2",
"typescript": "4.6.4"
Expand Down
27 changes: 10 additions & 17 deletions src/Commands/Make/Test.js
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@
*/

import { Path } from '@secjs/utils'
import { Artisan, Command, TemplateHelper } from '@athenna/artisan'
import { Command } from '@athenna/artisan'

export class MakeTest extends Command {
/**
Expand Down Expand Up @@ -56,29 +56,22 @@ export class MakeTest extends Command {
*/
async handle(name, options) {
let resource = 'Test'
let subPath = Path.tests('E2E')

if (options.unit) {
subPath = Path.tests('Unit')
}
let template = 'test'
let path = Path.tests(`E2E/${name}.js`)

if (!options.class) {
resource = 'TestFn'
template = 'testFn'
}

if (options.unit) {
path = Path.tests(`Unit/${name}.js`)
}

this.simpleLog(
`[ MAKING ${resource.toUpperCase()} ]\n`,
'rmNewLineStart',
'bold',
'green',
)
this.title(`MAKING ${resource}\n`, 'bold', 'green')

const file = await TemplateHelper.getResourceFile(name, resource, subPath)
const file = await this.makeFile(path, template, options.lint)

this.success(`${resource} ({yellow} "${file.name}") successfully created.`)

if (options.lint) {
await Artisan.call(`eslint:fix ${file.path} --resource ${resource}`)
}
}
}
4 changes: 2 additions & 2 deletions src/Commands/Test.js
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@
*/

import { Command } from '@athenna/artisan'
import { Path, Config } from '@secjs/utils'
import { Path, Config, Module } from '@secjs/utils'

export class Test extends Command {
/**
Expand Down Expand Up @@ -76,6 +76,6 @@ export class Test extends Command {
process.env.DEBUG = 'api:*'
}

await import(Path.tests('main.js'))
await Module.import(Path.tests('main.js'))
}
}
7 changes: 4 additions & 3 deletions src/Helpers/TestCommandsLoader.js
Original file line number Diff line number Diff line change
Expand Up @@ -17,8 +17,9 @@ export class TestCommandsLoader {
* @return {any[]}
*/
static loadTemplates() {
return new Folder(
join(Module.createDirname(import.meta.url), '..', '..', 'templates'),
).loadSync().files
const dirname = Module.createDirname(import.meta.url)
const templatesPath = join(dirname, '..', '..', 'templates')

return new Folder(templatesPath).loadSync().getFilesByPattern('**/*.ejs')
}
}
File renamed without changes.
File renamed without changes.
2 changes: 1 addition & 1 deletion tests/Stubs/config/logging.js
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@ export default {
formatterConfig: {},
},
console: {
driver: 'console',
driver: 'null',
formatter: 'cli',
streamType: 'stdout',
formatterConfig: {},
Expand Down

0 comments on commit a4139c6

Please sign in to comment.