1 | #!/usr/bin/env -S node --no-warnings --loader ts-node/esm
|
2 |
|
3 | import { test } from 'tstest'
|
4 |
|
5 | import { packageJson } from './package-json.js'
|
6 |
|
7 | test('Make sure the packageJson is fresh in source code', async t => {
|
8 | const json = JSON.parse(JSON.stringify(packageJson))
|
9 | /**
|
10 | * Delete test data (keys), which will
|
11 | * be overwrite
|
12 | * by the real data before deploy
|
13 | */
|
14 | delete json['wechaty']
|
15 |
|
16 | const keyNum = Object.keys(json).length
|
17 | t.equal(keyNum, 0, 'packageJson should be empty in source code, only updated before publish to NPM')
|
18 | })
|