exclusive-coupon-use.test.js 415 B

123456789101112
  1. import test from 'node:test'
  2. import assert from 'node:assert/strict'
  3. import fs from 'node:fs'
  4. import path from 'node:path'
  5. const couponPageFile = path.resolve('pagesMy/exclusiveScroll.vue')
  6. test('专享券点击使用前必须校验活动关联', () => {
  7. const source = fs.readFileSync(couponPageFile, 'utf8')
  8. assert.match(source, /const handleUse\s*=\s*item\s*=>\s*\{[\s\S]*?if\s*\(!item\.activityId\)/)
  9. })