Files
wehub-resource-sync b9e05427b1
test / test (push) Failing after 1s
chore: import upstream snapshot with attribution
2026-07-13 12:01:02 +08:00

24 lines
863 B
JavaScript

#!/usr/bin/env node
// The README tells users to run `node scripts/uninstall.js`, so the npm package
// must actually ship it. Guard the files entry so it can't silently drop out.
const test = require('node:test');
const assert = require('node:assert/strict');
const fs = require('fs');
const path = require('path');
const root = path.join(__dirname, '..');
test('npm package ships the advertised cleanup script', () => {
const pkg = JSON.parse(fs.readFileSync(path.join(root, 'package.json'), 'utf8'));
assert.ok(
pkg.files.includes('scripts/uninstall.js'),
'package.json "files" must include scripts/uninstall.js (README tells users to run it)',
);
// And the file it points at must exist.
assert.ok(
fs.existsSync(path.join(root, 'scripts', 'uninstall.js')),
'scripts/uninstall.js is listed in files but missing on disk',
);
});