Skip to content

Commit cd296e5

Browse files
committed
Remove redundant export from the script
Use babel rewire plugin to access internal functions of the script for testing
1 parent ed22117 commit cd296e5

File tree

4 files changed

+34
-28
lines changed

4 files changed

+34
-28
lines changed

theme-switch.js

Lines changed: 12 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -276,20 +276,19 @@ function animateThemeButtonIconToDark() {
276276
shadowRoot.getElementById("eclipse-anim-come").beginElement();
277277
}
278278

279-
// Export for tests run by npm.
279+
// Export for tests run by npm (no longer needed; kept for future reference)
280280
// See https://stackoverflow.com/q/63752210/8583692
281281
// and https://stackoverflow.com/a/54680602/8583692
282282
// and https://stackoverflow.com/q/43042889/8583692
283283
// and https://stackoverflow.com/a/1984728/8583692
284-
if (typeof module !== "undefined") {
285-
module.exports = {
286-
updateTheme,
287-
toggleTheme,
288-
getSystemTheme,
289-
getUserThemeSelection,
290-
getInitialStateForIcon,
291-
animateThemeButtonIconToAuto,
292-
animateThemeButtonIconToDark,
293-
animateThemeButtonIconToLight
294-
};
295-
}
284+
// if (typeof module !== "undefined") {
285+
// module.exports = {
286+
// updateTheme,
287+
// toggleTheme,
288+
// getSystemTheme,
289+
// getInitialStateForIcon,
290+
// animateThemeButtonIconToAuto,
291+
// animateThemeButtonIconToDark,
292+
// animateThemeButtonIconToLight
293+
// };
294+
// }

theme-switch.min.js

Lines changed: 1 addition & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

0 commit comments

Comments
 (0)