-
Notifications
You must be signed in to change notification settings - Fork 2
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
2 changed files
with
22 additions
and
0 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
// TODO: this will setup test index.html and put a default config to package.json |
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,21 @@ | ||
import fs from 'fs/promises'; | ||
import chalk from 'chalk'; | ||
|
||
export default async function() { | ||
const targetFilePath = process.argv[3] ? process.argv[2] : // if 3 params get from second the path or make dasherized 'test/test-module-name' | ||
const targetPath = `${process.cwd()}/test/${targetFilePath}`; // get from projectJSON | ||
const moduleName = ''; // if 3 params 3rd if 2 params 2nd. | ||
|
||
await fs.writeFile( | ||
targetPath, | ||
` | ||
import { module, test } from 'qunitx'; | ||
module('{{moduleName}}', function() { | ||
test('asserts true', function(assert) { | ||
assert.equal(true, true); | ||
}); | ||
});`.trim().replace('{{moduleName}}', moduleName)); | ||
|
||
console.log(chalk.magenta.bold(`${moduleName} qunitx test file created on:`), chalk.yellow(`${targetPath}`)); | ||
} |