Skip to content
This repository was archived by the owner on Oct 6, 2025. It is now read-only.

Commit 6a2a83f

Browse files
committed
Refactor test to also work on Windows node.js 8
1 parent b5ad1f7 commit 6a2a83f

File tree

1 file changed

+3
-2
lines changed

1 file changed

+3
-2
lines changed

test/php.test.js

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -107,14 +107,15 @@ describe('it should load php language files', function () {
107107
});
108108

109109
it('should register translation files as dependencies for live reloading', function () {
110-
let dependency;
110+
let dependency = '';
111111
const loaderMock = { addDependency: (dep) => {
112112
dependency = dep;
113113
} };
114114

115115
phpLoader.execute('./test/fixtures/php-with-namespace', {}, loaderMock);
116116

117117
const expected = '/test/fixtures/php-with-namespace/en/validation.php';
118-
assert.strictEqual(dependency.endsWith(expected), true);
118+
const actual = dependency.substring(dependency.length - expected.length);
119+
assert.deepStrictEqual(actual.split(path.sep), expected.split('/'));
119120
});
120121
});

0 commit comments

Comments
 (0)