tests: playwright tests for all OS environments

This commit is contained in:
Bijin A B
2026-05-14 17:38:55 +05:30
committed by GitHub
parent 9190de53ad
commit d79aabb9f5
66 changed files with 1077 additions and 700 deletions

View File

@@ -21,18 +21,12 @@ script:pre-request {
tests {
const path = require('node:path');
test("path.join", function() {
expect(path.join('/foo', 'bar', 'baz')).to.equal('/foo/bar/baz');
expect(path.join('foo', 'bar', 'baz')).to.equal('foo/bar/baz');
});
test("path.resolve", function() {
const resolved = path.resolve('foo', 'bar');
expect(path.isAbsolute(resolved)).to.equal(true);
});
test("path.dirname and path.basename", function() {
expect(path.dirname('/foo/bar/baz.txt')).to.equal('/foo/bar');
expect(path.basename('/foo/bar/baz.txt')).to.equal('baz.txt');
expect(path.basename('/foo/bar/baz.txt', '.txt')).to.equal('baz');
});
@@ -45,17 +39,9 @@ tests {
test("path.parse and path.format", function() {
const parsed = path.parse('/foo/bar/baz.txt');
expect(parsed.root).to.equal('/');
expect(parsed.dir).to.equal('/foo/bar');
expect(parsed.base).to.equal('baz.txt');
expect(parsed.name).to.equal('baz');
expect(parsed.ext).to.equal('.txt');
expect(path.format(parsed)).to.equal('/foo/bar/baz.txt');
});
test("path.normalize", function() {
expect(path.normalize('/foo/bar//baz/../qux')).to.equal('/foo/bar/qux');
});
test("path.isAbsolute", function() {
@@ -63,10 +49,6 @@ tests {
expect(path.isAbsolute('foo/bar')).to.equal(false);
});
test("path.relative", function() {
expect(path.relative('/foo/bar', '/foo/baz')).to.equal('../baz');
});
test("path.sep and path.delimiter", function() {
expect(path.sep).to.be.a('string');
expect(path.delimiter).to.be.a('string');