Skip to content

Commit

Permalink
fix test
Browse files Browse the repository at this point in the history
  • Loading branch information
Chang Zhe Jiet authored and Chang Zhe Jiet committed Mar 28, 2024
1 parent c79cc67 commit e8d8d0e
Show file tree
Hide file tree
Showing 3 changed files with 71 additions and 567 deletions.
8 changes: 6 additions & 2 deletions test/tfg/Base.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -295,8 +295,12 @@ test('Base', () => {
expect(tfg.getVars()).toMatchSnapshot();
expect(tfg.generate()).toMatchSnapshot();

tfg.write({ dir: outputDir });
const tf = fs.readFileSync(path.join(outputDir, 'terraform.tf'), 'utf8');
tfg.write({
dir: outputDir,
tfFilename: 'base',
tfvarsFilename: 'base'
});
const tf = fs.readFileSync(path.join(outputDir, 'base.tf'), 'utf8');
expect(tf).toMatchSnapshot();
});

10 changes: 7 additions & 3 deletions test/tfg/Others.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -107,9 +107,13 @@ test('Others', () => {
expect(tfg.getVars()).toMatchSnapshot();
expect(tfg.generate()).toMatchSnapshot();

tfg.write({ dir: outputDir });
const tf = fs.readFileSync(path.join(outputDir, 'terraform.tf'), 'utf8');
tfg.write({
dir: outputDir,
tfFilename: 'others',
tfvarsFilename: 'others'
});
const tf = fs.readFileSync(path.join(outputDir, 'others.tf'), 'utf8');
expect(tf).toMatchSnapshot();
const tfvars = fs.readFileSync(path.join(outputDir, 'terraform.tfvars'), 'utf8');
const tfvars = fs.readFileSync(path.join(outputDir, 'others.tfvars'), 'utf8');
expect(tfvars).toMatchSnapshot();
});
Loading

0 comments on commit e8d8d0e

Please sign in to comment.