-
-
Save azu/a975fec9a1bcef1bf10e838c14db537a to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import { PerformanceMetadataMarker } from "performance-mark-metadata"; | |
const marker = new PerformanceMetadataMarker(); | |
const metadata = { | |
details: { key: "value" } | |
}; | |
const markerName = "name"; | |
// mark with metadata | |
marker.mark(markerName, metadata); | |
performance.getEntriesByName(markerName).forEach(entry => { | |
// get metadata for entry | |
const result = marker.getEntryMetadata(entry); | |
/* | |
{ | |
details: { key: "value" } | |
}; | |
*/ | |
assert.strictEqual(result, metadata, "should get same metadata"); | |
}); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment