Skip to content

Commit 7f0f40d

Browse files
committed
test: wait for init config reads
1 parent 9252705 commit 7f0f40d

1 file changed

Lines changed: 4 additions & 14 deletions

File tree

test/runner/init_test.js

Lines changed: 4 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -69,13 +69,8 @@ describe('Init Command', function () {
6969
fs.existsSync(path.join(codecept_dir, 'codecept.conf.js')).should.be.true
7070
fs.existsSync(path.join(codecept_dir, 'steps_file.js')).should.be.true
7171

72-
fs.readFile(path.join(codecept_dir, 'codecept.conf.js'), 'utf8', (err, data) => {
73-
if (err) {
74-
throw Error(err);
75-
return;
76-
}
77-
data.should.contain('./steps_file.js');
78-
});
72+
const config = fs.readFileSync(path.join(codecept_dir, 'codecept.conf.js'), 'utf8')
73+
config.should.contain('./steps_file.js')
7974
})
8075

8176
it('should initialize a TS project', async () => {
@@ -96,12 +91,7 @@ describe('Init Command', function () {
9691
fs.existsSync(path.join(codecept_dir, 'codecept.conf.ts')).should.be.true
9792
fs.existsSync(path.join(codecept_dir, 'steps_file.ts')).should.be.true
9893

99-
fs.readFile(path.join(codecept_dir, 'codecept.conf.ts'), 'utf8', (err, data) => {
100-
if (err) {
101-
throw Error(err);
102-
return;
103-
}
104-
data.should.contain('./steps_file.ts');
105-
});
94+
const config = fs.readFileSync(path.join(codecept_dir, 'codecept.conf.ts'), 'utf8')
95+
config.should.contain('./steps_file.ts')
10696
})
10797
})

0 commit comments

Comments
 (0)