Skip to content

Commit

Permalink
doc(example): use turbu test for testing project
Browse files Browse the repository at this point in the history
  • Loading branch information
cedricduffournet committed Feb 19, 2022
1 parent 8bdef1c commit 9fbdbee
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 12 deletions.
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
{
"description": "Store Testing Tutorial",
"files": ["!**/*.d.ts", "**/*.spec.ts"]
"files": ["!**/*.d.ts", "**/*.spec.ts"],
"type": "testing"
}
15 changes: 4 additions & 11 deletions projects/ngrx.io/tools/stackblitz-builder/builder.js
Original file line number Diff line number Diff line change
Expand Up @@ -13,13 +13,6 @@ class StackblitzBuilder {
this.basePath = basePath;
this.destPath = destPath;

// Extract npm package dependencies
const packageJson = require(path.join(
__dirname,
'../examples/shared/boilerplate/cli/package.json'
));
this.examplePackageDependencies = packageJson.dependencies;

this.copyrights = {};
this._buildCopyrightStrings();
}
Expand All @@ -35,7 +28,7 @@ class StackblitzBuilder {
});
fileNames.forEach((configFileName) => {
try {
// console.log('***'+configFileName)
console.log('***' + configFileName);
this._buildStackblitzFrom(configFileName);
} catch (e) {
console.log(e);
Expand Down Expand Up @@ -79,7 +72,7 @@ class StackblitzBuilder {
const config = this._initConfigAndCollectFileNames(configFileName);
const postData = this._createPostData(config, configFileName);

this._addStackblitzrc(postData);
this._addStackblitzrc(postData, config);

const html = this._createStackblitzHtml(config, postData);
fs.writeFileSync(outputFileName, html, 'utf-8');
Expand Down Expand Up @@ -150,10 +143,10 @@ class StackblitzBuilder {
}
}

_addStackblitzrc(postData) {
_addStackblitzrc(postData, config) {
postData['project[files][.stackblitzrc]'] = JSON.stringify({
installDependencies: true,
startCommand: 'turbo start',
startCommand: `turbo ${config?.type === 'testing' ? 'test' : 'start'}`,
env: {
ENABLE_CJS_IMPORTS: true,
},
Expand Down

0 comments on commit 9fbdbee

Please sign in to comment.