Skip to content

Commit 16f3e71

Browse files
committed
Fix config generation test (use current folder name)
1 parent fc22b25 commit 16f3e71

File tree

1 file changed

+4
-2
lines changed

1 file changed

+4
-2
lines changed

test/config.test.js

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -44,7 +44,9 @@ const users = [
4444
askAgain: false,
4545
},
4646
];
47-
const configPath = path.join(process.cwd(), 'exoframe.json');
47+
const cwd = process.cwd();
48+
const folderName = path.basename(cwd);
49+
const configPath = path.join(cwd, 'exoframe.json');
4850

4951
const verifyBasicAuth = (input, actual) => {
5052
actual.split(',').forEach((element, index) => {
@@ -148,7 +150,7 @@ test('Should generate config file for functions', done => {
148150
expect(consoleSpy.args).toMatchSnapshot();
149151
// then check config changes
150152
const cfg = yaml.safeLoad(fs.readFileSync(configPath, 'utf8'));
151-
expect(cfg.name).toEqual('exoframe-cli');
153+
expect(cfg.name).toEqual(folderName);
152154
expect(cfg.function).toEqual(true);
153155
// restore console
154156
console.log.restore();

0 commit comments

Comments
 (0)