MCPcopy Index your code
hub / github.com/nodejs/node / write

Method write

test/common/wpt.js:122–149  ·  view source on GitHub ↗

* @returns {void}

()

Source from the content-addressed store, hash-verified

120 * @returns {void}
121 */
122 write() {
123 this.time_end = Date.now();
124 const results = Array.from(this.results.values())
125 .map((result) => {
126 const url = new URL(result.test, 'http://wpt');
127 url.pathname = url.pathname.replace(/\.js$/, '.html');
128 result.test = url.href.slice(url.origin.length);
129 return result;
130 });
131
132 /**
133 * Return required and some optional properties
134 * https://github.com/web-platform-tests/wpt.fyi/blob/60da175/api/README.md?plain=1#L331-L335
135 */
136 this.run_info = {
137 product: 'node.js',
138 ...getBrowserProperties(),
139 revision: process.env.WPT_REVISION || 'unknown',
140 os: getOs(),
141 };
142
143 fs.writeFileSync(this.filepath, JSON.stringify({
144 time_start: this.time_start,
145 time_end: this.time_end,
146 run_info: this.run_info,
147 results: results,
148 }));
149 }
150}
151
152// https://github.com/web-platform-tests/wpt/blob/HEAD/resources/testharness.js

Calls 8

getBrowserPropertiesFunction · 0.85
getOsFunction · 0.85
nowMethod · 0.80
mapMethod · 0.65
sliceMethod · 0.65
fromMethod · 0.45
valuesMethod · 0.45
writeFileSyncMethod · 0.45

Tested by

no test coverage detected