MCPcopy
hub / github.com/webpack/webpack / findOurLink

Function findOurLink

test/hotCases/css/hmr-extra-links/index.js:3–12  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

1import "./index.css";
2
3const findOurLink = () => {
4 const link = [...window.document.getElementsByTagName("link")].find(
5 (item) =>
6 item.rel === "stylesheet" &&
7 item.href &&
8 item.href.includes("bundle.css")
9 );
10 expect(link).toBeDefined();
11 return link;
12};
13
14it("should not touch non-stylesheet, data:, anchor or external links during CSS HMR", (done) => {
15 const head = window.document.head;

Callers 1

index.jsFile · 0.70

Calls 1

getElementsByTagNameMethod · 0.80

Tested by

no test coverage detected