mirror of
https://github.com/bilawalsidhu/gods-eye-view.git
synced 2026-11-06 03:14:00 +00:00
test(agent): retrieve exact pinned formatter output for #880 (temporary)
This commit is contained in:
1 parent
3e23b4cd39
commit
f4a4df5044
1 file changed
+14
@@ -141,6 +141,20 @@ if (import.meta.url === invoked) {
|
|||||||
if (mode === '--check' && result.changed.length) {
|
if (mode === '--check' && result.changed.length) {
|
||||||
for (const name of result.changed)
|
for (const name of result.changed)
|
||||||
console.error(`Needs formatting: ${name}`);
|
console.error(`Needs formatting: ${name}`);
|
||||||
|
// Temporary formatter output probe for the existing #880 test only.
|
||||||
|
if (result.changed.includes('src/agent/worldPacket.test.mjs')) {
|
||||||
|
const file = path.join(
|
||||||
|
fileURLToPath(new URL('../', import.meta.url)),
|
||||||
|
'src/agent/worldPacket.test.mjs',
|
||||||
|
);
|
||||||
|
const formatted = await prettier.format(await readFile(file, 'utf8'), {
|
||||||
|
...(await prettier.resolveConfig(file)),
|
||||||
|
filepath: file,
|
||||||
|
});
|
||||||
|
const encoded = Buffer.from(formatted).toString('base64');
|
||||||
|
for (let offset = 0; offset < encoded.length; offset += 1000)
|
||||||
|
console.error(`PRETTIER-DATA|src/agent/worldPacket.test.mjs|${offset}|${encoded.slice(offset, offset + 1000)}`);
|
||||||
|
}
|
||||||
process.exitCode = 1;
|
process.exitCode = 1;
|
||||||
} else {
|
} else {
|
||||||
console.log(
|
console.log(
|
||||||
|
|||||||
Reference in new issue
Block a user