|
|
@@ -0,0 +1,12 @@
|
|
|
+import assert from 'node:assert/strict'
|
|
|
+import fs from 'node:fs'
|
|
|
+import path from 'node:path'
|
|
|
+import test from 'node:test'
|
|
|
+
|
|
|
+const manifestFile = path.resolve('manifest.json')
|
|
|
+
|
|
|
+test('微信小程序启用自定义组件按需注入', () => {
|
|
|
+ const source = fs.readFileSync(manifestFile, 'utf8')
|
|
|
+
|
|
|
+ assert.match(source, /"mp-weixin"\s*:\s*\{[\s\S]*?"setting"\s*:\s*\{[\s\S]*?"lazyCodeLoading"\s*:\s*"requiredComponents"/)
|
|
|
+})
|