-
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 #18 from Enet4/imp/3.3.2
Add Dicoogle v3.3.2
- Loading branch information
Showing
6 changed files
with
108 additions
and
6 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,70 @@ | ||
const path = require('path'); | ||
const helpers = require('yeoman-test'); | ||
const child_process = require('child_process'); | ||
|
||
describe('generator test 3: result-batch webplugin project in TypeScript', () => { | ||
/** @type {helpers.RunResult} */ | ||
let runResult; | ||
|
||
beforeEach(async () => { | ||
runResult = await helpers | ||
.create(path.join(__dirname, '..')) | ||
.withPrompts({ | ||
appname: "plugin3", | ||
description: "A test plugin (#3)", | ||
slotId: "result-batch", | ||
caption: "Test3", | ||
minimumVersion: "3.3.2", | ||
projectType: "typescript", | ||
license: "MIT", | ||
authorName: "John Doe", | ||
authorEmail: "doe.j@nowhere", | ||
authorGithub: "", | ||
}) | ||
.run(); | ||
}); | ||
afterEach(() => { | ||
if (runResult) { | ||
runResult.restore(); | ||
} | ||
}); | ||
|
||
it('generates correctly', () => { | ||
// contains package.json | ||
runResult.assertJsonFileContent('package.json', { | ||
name: "plugin3", | ||
description: "A test plugin (#3)", | ||
license: "MIT", | ||
scripts: { | ||
"build": /.+/, | ||
}, | ||
dicoogle: { | ||
"slot-id": "result-batch", | ||
"caption": "Test3", | ||
"module-file": "module.js" | ||
}, | ||
devDependencies: { | ||
webpack: /.+/, | ||
} | ||
}); | ||
|
||
// has source files and build files | ||
runResult.assertFile([ | ||
'src/index.ts', | ||
'webpack.common.js', | ||
'webpack.dev.js', | ||
'webpack.prod.js', | ||
'.gitignore', | ||
'README.md', | ||
]); | ||
|
||
runResult.assertFileContent('src/index.ts', 'export default class MyPlugin'); | ||
runResult.assertFileContent('src/index.ts', "slot.addEventListener('result-selection-ready', (ev) => {"); | ||
|
||
// force running npm install on target directory | ||
child_process.execSync('npm install --no-audit', {cwd: runResult.cwd}); | ||
|
||
// has the output file module.js via `prepare` | ||
runResult.assertFileContent('module.js', 'module.exports'); | ||
}); | ||
}); |
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