Skip to content

Commit

Permalink
Merge pull request #21 from hadiindrawan/dev
Browse files Browse the repository at this point in the history
fix runner name issue
  • Loading branch information
hadiindrawan authored Apr 3, 2023
2 parents c1cf9b5 + 61e2ac3 commit 985a810
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 9 deletions.
10 changes: 2 additions & 8 deletions lib/component/runner.js
Original file line number Diff line number Diff line change
Expand Up @@ -19,8 +19,6 @@ async function writeRunner(element, testPath, runPath, moduleType) {
let namet = (item.name).toLowerCase().replace(/\s/g, '')
namet = namet.replace(/\//g, '')
namet = namet.replace('-', '_')
namet = namet.replace('(', '_')
namet = namet.replace(')', '_')

let method
if (item.request.hasOwnProperty('method')) {
Expand All @@ -29,11 +27,11 @@ async function writeRunner(element, testPath, runPath, moduleType) {
if (item.request.hasOwnProperty('url')) {
if (moduleType == "Javascript modules (import/export)") {
if (first === false) runner += '\r\n'
runner += "import " + namet + " from '"+ testPath + '/' + method + '_' + namet + ".spec.js'"
runner += "import " + (namet.replace('(', '_')).replace(')', '_') + " from '"+ testPath + '/' + method + '_' + namet + ".spec.js'"
first = false;

if (fisrtExe === false) importExe += '\r\n'
importExe += namet + "()"
importExe += (namet.replace('(', '_')).replace(')', '_') + "()"
fisrtExe = false;
} else {
if (first === false) runner += '\r\n'
Expand All @@ -46,10 +44,6 @@ async function writeRunner(element, testPath, runPath, moduleType) {
} else {
let namet = (element.name).toLowerCase().replace(/\s/g, '')
namet = namet.replace(/\//g, '')
namet = namet.replace('-', '_')
namet = namet.replace('-', '_')
namet = namet.replace('(', '_')
namet = namet.replace(')', '_')

let method
if (element.request.hasOwnProperty('method')) {
Expand Down
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@dot.indonesia/po-gen",
"version": "1.4.7",
"version": "1.4.8",
"main": "index.js",
"scripts": {
"test": "echo \"Error: no test specified\" && exit 1",
Expand Down

0 comments on commit 985a810

Please sign in to comment.