Skip to content

Commit 8c95634

Browse files
committed
Revert unrelated lint changes
1 parent ffbac8a commit 8c95634

File tree

1 file changed

+2
-66
lines changed

1 file changed

+2
-66
lines changed

packages/php-wasm/node/src/test/symlinks.spec.ts

Lines changed: 2 additions & 66 deletions
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,5 @@
11
import { loadNodeRuntime } from '..';
2-
import {
3-
__private__dont__use,
4-
FSHelpers,
5-
PHP,
6-
setPhpIniEntries,
7-
} from '@php-wasm/universal';
2+
import { PHP, setPhpIniEntries } from '@php-wasm/universal';
83
import fs from 'fs';
94
import path from 'path';
105
import { createNodeFsMountHandler } from '../lib/node-fs-mount';
@@ -65,6 +60,7 @@ testSymlinks.forEach(({ name, sourcePath, symlinkPath }) => {
6560
);
6661
}
6762

63+
await php.mkdir('/folder-with-symlinks');
6864
await php.mount(
6965
'/folder-with-symlinks',
7066
createNodeFsMountHandler(
@@ -354,65 +350,5 @@ testSymlinks.forEach(({ name, sourcePath, symlinkPath }) => {
354350
}
355351
});
356352
});
357-
358-
describe('Test symlink file system operations', () => {
359-
const symlinkPath = path.join(
360-
__dirname,
361-
'test-data',
362-
'symlink.txt'
363-
);
364-
const symlinkTarget = path.join(
365-
__dirname,
366-
'test-data',
367-
'long-post-body.txt'
368-
);
369-
const vfsMountPoint = '/symlink.txt';
370-
beforeEach(async () => {
371-
fs.symlinkSync(symlinkTarget, symlinkPath, 'file');
372-
373-
await php.mount(
374-
vfsMountPoint,
375-
createNodeFsMountHandler(symlinkPath)
376-
);
377-
});
378-
afterEach(async () => {
379-
fs.unlinkSync(symlinkPath);
380-
});
381-
382-
it('Should mount a symlink', async () => {
383-
expect(php.isFile(vfsMountPoint)).toBe(true);
384-
expect(php.readFileAsText(vfsMountPoint)).toEqual(
385-
fs.readFileSync(symlinkTarget, 'utf8')
386-
);
387-
});
388-
it('Should be recognized as a symlink', async () => {
389-
expect(php.fileExists(vfsMountPoint)).toBe(true);
390-
expect(php.isSymlink(vfsMountPoint)).toBe(true);
391-
});
392-
it('Should copy a symlink', async () => {
393-
const newVfsMountPoint = '/symlink-copy.txt';
394-
FSHelpers.copyRecursive(
395-
php[__private__dont__use].FS,
396-
vfsMountPoint,
397-
newVfsMountPoint
398-
);
399-
expect(php.fileExists(vfsMountPoint)).toBe(true);
400-
expect(php.isSymlink(vfsMountPoint)).toBe(true);
401-
expect(php.fileExists(newVfsMountPoint)).toBe(true);
402-
expect(php.isSymlink(newVfsMountPoint)).toBe(true);
403-
expect(php.readlink(newVfsMountPoint)).toBe(
404-
php.readlink(vfsMountPoint)
405-
);
406-
});
407-
408-
it.skip('Should move a symlink', async () => {
409-
// Symlinks can't be moved because of a Resource busy error.
410-
// TODO: Compare POSIX and Emscripten behavior.
411-
const newVfsMountPoint = '/symlink-moved.txt';
412-
php.mv(vfsMountPoint, newVfsMountPoint);
413-
expect(php.fileExists(vfsMountPoint)).toBe(false);
414-
expect(php.fileExists(newVfsMountPoint)).toBe(true);
415-
});
416-
});
417353
});
418354
});

0 commit comments

Comments
 (0)