Files
danyang-match/h5-demo/tests/demo-login-contract.cjs
T

15 lines
687 B
JavaScript

const assert = require('node:assert/strict')
const fs = require('node:fs')
const path = require('node:path')
const root = path.resolve(__dirname, '..')
const authService = fs.readFileSync(path.join(root, 'src/api/services/auth.ts'), 'utf8')
const authStore = fs.readFileSync(path.join(root, 'src/stores/auth.ts'), 'utf8')
const backendController = fs.readFileSync(path.resolve(root, '../backend/src/main/java/com/danyang/match/platform/auth/controller/AuthController.java'), 'utf8')
assert.match(authService, /demoLogin\(/)
assert.match(authStore, /authService\.demoLogin\(/)
assert.match(backendController, /@PostMapping\("\/demo\/login"\)/)
console.log('PASS: demo login contract')