forked from gautamkrishnar/blog-post-workflow
-
Notifications
You must be signed in to change notification settings - Fork 0
/
local-run.js
24 lines (23 loc) · 763 Bytes
/
local-run.js
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
const process = require('process');
const path = require('path');
const fs = require('fs');
const {DEFAULT_TEST_ENV} = require('./test/testUtils/default-env');
// language=markdown
const template = `# Readme test
Post list example:
<!-- BLOG-POST-LIST:START -->
<!-- BLOG-POST-LIST:END -->
# Other contents
Test content
`;
fs.writeFile(path.join(__dirname, 'test', 'Readme.md'), template, () => {
console.log('Written test file....');
Object.assign(process.env, {
...DEFAULT_TEST_ENV,
INPUT_README_PATH: path.join(__dirname, 'test', 'Readme.md')
});
const testFile = process.env.DIST ? './dist/blog-post-workflow' : './src/blog-post-workflow';
console.log('Testing: ', testFile);
const action = require(testFile);
action.runWorkflow();
});