test fixes for Node.js v20
Signed-off-by: Patrik Oldsberg <poldsberg@gmail.com>
This commit is contained in:
+3
-3
@@ -85,8 +85,8 @@ describe('fs:rename examples', () => {
|
||||
const sourceFilePath = resolvePath(workspacePath, sourceFile);
|
||||
const destFilePath = resolvePath(workspacePath, destFile);
|
||||
|
||||
const sourceBeforeContent = fs.readFileSync(sourceFilePath, 'utf-8');
|
||||
const destBeforeContent = fs.readFileSync(destFilePath, 'utf-8');
|
||||
const sourceBeforeContent = await fs.readFile(sourceFilePath, 'utf-8');
|
||||
const destBeforeContent = await fs.readFile(destFilePath, 'utf-8');
|
||||
|
||||
expect(sourceBeforeContent).not.toEqual(destBeforeContent);
|
||||
|
||||
@@ -97,7 +97,7 @@ describe('fs:rename examples', () => {
|
||||
},
|
||||
});
|
||||
|
||||
const destAfterContent = fs.readFileSync(destFilePath, 'utf-8');
|
||||
const destAfterContent = await fs.readFile(destFilePath, 'utf-8');
|
||||
|
||||
expect(sourceBeforeContent).toEqual(destAfterContent);
|
||||
});
|
||||
|
||||
@@ -148,7 +148,7 @@ describe('fs:rename', () => {
|
||||
it('should throw is trying to override by mistake', async () => {
|
||||
const destFile = 'unit-test-c.js';
|
||||
const filePath = resolvePath(workspacePath, destFile);
|
||||
const beforeContent = fs.readFileSync(filePath, 'utf-8');
|
||||
const beforeContent = await fs.readFile(filePath, 'utf-8');
|
||||
|
||||
await expect(
|
||||
action.handler({
|
||||
@@ -164,7 +164,7 @@ describe('fs:rename', () => {
|
||||
}),
|
||||
).rejects.toThrow(/dest already exists/);
|
||||
|
||||
const afterContent = fs.readFileSync(filePath, 'utf-8');
|
||||
const afterContent = await fs.readFile(filePath, 'utf-8');
|
||||
|
||||
expect(beforeContent).toEqual(afterContent);
|
||||
});
|
||||
@@ -191,8 +191,8 @@ describe('fs:rename', () => {
|
||||
const sourceFilePath = resolvePath(workspacePath, sourceFile);
|
||||
const destFilePath = resolvePath(workspacePath, destFile);
|
||||
|
||||
const sourceBeforeContent = fs.readFileSync(sourceFilePath, 'utf-8');
|
||||
const destBeforeContent = fs.readFileSync(destFilePath, 'utf-8');
|
||||
const sourceBeforeContent = await fs.readFile(sourceFilePath, 'utf-8');
|
||||
const destBeforeContent = await fs.readFile(destFilePath, 'utf-8');
|
||||
|
||||
expect(sourceBeforeContent).not.toEqual(destBeforeContent);
|
||||
|
||||
@@ -209,7 +209,7 @@ describe('fs:rename', () => {
|
||||
},
|
||||
});
|
||||
|
||||
const destAfterContent = fs.readFileSync(destFilePath, 'utf-8');
|
||||
const destAfterContent = await fs.readFile(destFilePath, 'utf-8');
|
||||
|
||||
expect(sourceBeforeContent).toEqual(destAfterContent);
|
||||
});
|
||||
|
||||
Reference in New Issue
Block a user