Skip to content

Commit ac779dd

Browse files
committed
test: update Safari 15 private property E2E for babel changes
Recent babel downlevelling changes for private properties require adjustments to the test expectations for the `misc/safari-15-class-properties` E2E test. This E2E test ensured that private class properties are downlevelled when Safari 15 is present in the supported browsers list to workaround Safari bugs that were present in these older versions of the browser. (cherry picked from commit 1ae6252)
1 parent 3394d3c commit ac779dd

File tree

1 file changed

+14
-5
lines changed

1 file changed

+14
-5
lines changed

Diff for: tests/legacy-cli/e2e/tests/misc/safari-15-class-properties.ts

+14-5
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,7 @@
11
import assert from 'node:assert';
22
import { expectFileToExist, readFile, writeFile, replaceInFile } from '../../utils/fs';
33
import { ng } from '../../utils/process';
4+
import { getGlobalVariable } from '../../utils/env';
45

56
const unexpectedStaticFieldErrorMessage =
67
'Found unexpected static field. This indicates that the Safari <=v15 ' +
@@ -55,9 +56,17 @@ export default async function () {
5556
unexpectedStaticFieldErrorMessage,
5657
);
5758

58-
assert.match(
59-
mainContentSafari15Explicit,
60-
/var _myPrivateMethod/,
61-
'Expected private method to be downlevelled when Safari <=v15 is targeted',
62-
);
59+
if (getGlobalVariable('argv')['esbuild']) {
60+
assert.match(
61+
mainContentSafari15Explicit,
62+
/var _myPrivateMethod/,
63+
'Expected private method to be downlevelled when Safari <=v15 is targeted',
64+
);
65+
} else {
66+
assert.match(
67+
mainContentSafari15Explicit,
68+
/_assertClassBrand/,
69+
'Expected private method to be downlevelled when Safari <=v15 is targeted',
70+
);
71+
}
6372
}

0 commit comments

Comments
 (0)