Skip to content
Toggle navigation
Projects
Groups
Snippets
Help
saas_plus
/
regional-assistant
This project
Loading...
Sign in
Toggle navigation
Go to a project
Project
Repository
Issues
0
Merge Requests
0
Pipelines
Wiki
Settings
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Commit 49290088
authored
Aug 12, 2026
by
张立顺
Browse Files
Options
Browse Files
Tag
Download
Email Patches
Plain Diff
test: harden miniprogram npm boundaries
1 parent
e1dbe420
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
19 additions
and
4 deletions
tests/work-order-migration/npm-dependency-prune.test.mjs
tests/work-order-migration/upload-config.test.mjs
tests/work-order-migration/npm-dependency-prune.test.mjs
View file @
4929008
...
...
@@ -35,12 +35,22 @@ describe('mini-program npm dependency pruning', () => {
const packageJson = JSON.parse(
await readFile(path.join(projectRoot, 'package.json'), 'utf8')
)
const packageLock = JSON.parse(
await readFile(path.join(projectRoot, 'package-lock.json'), 'utf8')
)
const yarnLock = await readFile(path.join(projectRoot, 'yarn.lock'), 'utf8')
const appConfig = JSON.parse(
await readFile(path.join(projectRoot, 'app.json'), 'utf8')
)
assert.equal(packageJson.dependencies['glsk-applet-component'], '^1.0.0')
assert.equal(
packageLock.packages[''].dependencies['glsk-applet-component'],
'^1.0.0'
)
assert.ok(packageLock.packages['node_modules/glsk-applet-component'])
assert.match(yarnLock, /^glsk-applet-component@\^1\.0\.0:\r?$/m)
assert.equal(
appConfig.usingComponents['glsx-privacy'],
'glsk-applet-component/GlsxPrivacy/index'
)
...
...
tests/work-order-migration/upload-config.test.mjs
View file @
4929008
...
...
@@ -43,8 +43,8 @@ describe('小程序上传边界', () => {
const config = JSON.parse(
await readFile(path.join(projectRoot, 'project.config.json'), 'utf8')
)
const ignored
= new Set
(
(config.packOptions?.ignore || []).map(item =>
item.value
)
const ignored
Types = new Map
(
(config.packOptions?.ignore || []).map(item =>
[item.value, item.type]
)
)
assert.equal(config.setting?.ignoreUploadUnusedFiles, true)
...
...
@@ -62,12 +62,17 @@ describe('小程序上传边界', () => {
'outputs',
'typings',
'.superpowers',
'test',
'test'
]) {
assert.equal(ignoredTypes.get(entry), 'folder', `未以目录忽略上传内容:${entry}`)
}
for (const entry of [
'project.private.config.json',
'yarn.lock',
'prettier-plugin-wxml.mjs'
]) {
assert.
ok(ignored.has(entry), `未忽略上传非运行时
内容:${entry}`)
assert.
equal(ignoredTypes.get(entry), 'file', `未以文件忽略上传
内容:${entry}`)
}
})
...
...
Write
Preview
Markdown
is supported
Attach a file
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to post a comment