@khanacademy/perseus-core
Advanced tools
Comparing version 0.0.0-PR745-20231004184900 to 0.0.0-PR745-20231004195820
# @khanacademy/perseus-core | ||
## 0.0.0-PR745-20231004184900 | ||
## 0.0.0-PR745-20231004195820 | ||
@@ -5,0 +5,0 @@ ### Patch Changes |
@@ -6,3 +6,3 @@ { | ||
"license": "MIT", | ||
"version": "0.0.0-PR745-20231004184900", | ||
"version": "0.0.0-PR745-20231004195820", | ||
"publishConfig": { | ||
@@ -9,0 +9,0 @@ "access": "public" |
@@ -9,4 +9,8 @@ import {addLibraryVersionToPerseusDebug} from "./add-library-version-to-perseus-debug"; | ||
it("should add the given library to __perseus_debug__", () => { | ||
// Array | ||
// Act | ||
addLibraryVersionToPerseusDebug("test-lib", "1.0.0"); | ||
// Assert | ||
expect(globalThis.__perseus_debug__).toMatchInlineSnapshot(` | ||
@@ -20,2 +24,5 @@ { | ||
it("should extend __perseus_debug__ when multiple libraries registered", () => { | ||
// Arrange | ||
// Act | ||
addLibraryVersionToPerseusDebug("test-lib", "1.0.0"); | ||
@@ -25,2 +32,3 @@ addLibraryVersionToPerseusDebug("sample-lib", "2.0.0"); | ||
// Assert | ||
expect(globalThis.__perseus_debug__).toMatchInlineSnapshot(` | ||
@@ -36,2 +44,6 @@ { | ||
it("should convert library entry to array when multiple versions of the same library registered", () => { | ||
// Arrange | ||
jest.spyOn(console, "warn").mockImplementation(); | ||
// Act | ||
addLibraryVersionToPerseusDebug("test-lib", "1.0.1"); | ||
@@ -42,2 +54,3 @@ addLibraryVersionToPerseusDebug("test-lib", "4.1.8"); | ||
// Assert | ||
expect(globalThis.__perseus_debug__).toMatchInlineSnapshot(` | ||
@@ -56,4 +69,6 @@ { | ||
it("should warn when multiple versions of the same library registered", () => { | ||
const warnSpy = jest.spyOn(console, "warn"); | ||
// Arrange | ||
const warnSpy = jest.spyOn(console, "warn").mockImplementation(); | ||
// Act | ||
addLibraryVersionToPerseusDebug("test-lib", "1.0.1"); | ||
@@ -64,2 +79,3 @@ addLibraryVersionToPerseusDebug("test-lib", "4.1.8"); | ||
// Assert | ||
expect(warnSpy).toHaveBeenCalledWith( | ||
@@ -73,2 +89,5 @@ expect.stringMatching( | ||
it("should not register duplicates for duplicate calls of the same library and version", () => { | ||
// Arrange | ||
// Act | ||
addLibraryVersionToPerseusDebug("test-lib", "1.0.0"); | ||
@@ -78,2 +97,3 @@ addLibraryVersionToPerseusDebug("test-lib", "1.0.0"); | ||
// Assert | ||
expect(globalThis.__perseus_debug__).toMatchInlineSnapshot(` | ||
@@ -87,4 +107,6 @@ { | ||
it("should not warn for duplicate calls for a library of the same library and version", () => { | ||
const warnSpy = jest.spyOn(console, "warn"); | ||
// Arrange | ||
const warnSpy = jest.spyOn(console, "warn").mockImplementation(); | ||
// Act | ||
addLibraryVersionToPerseusDebug("test-lib", "1.0.0"); | ||
@@ -94,4 +116,5 @@ addLibraryVersionToPerseusDebug("test-lib", "1.0.0"); | ||
// Assert | ||
expect(warnSpy).not.toHaveBeenCalled(); | ||
}); | ||
}); |
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
73340
421