assetUrl.test.js 573 B

123456789101112131415161718
  1. const assert = require('node:assert/strict')
  2. const { ASSET_BASE_URL, imageUrl } = require('../utils/assetUrl')
  3. assert.equal(ASSET_BASE_URL, 'https://transcend.ringzle.com/web/assets')
  4. assert.equal(
  5. imageUrl('fm_logo.png'),
  6. 'https://transcend.ringzle.com/web/assets/images/fm_logo.png'
  7. )
  8. assert.equal(
  9. imageUrl('/fm_logo.png'),
  10. 'https://transcend.ringzle.com/web/assets/images/fm_logo.png'
  11. )
  12. assert.equal(
  13. imageUrl('中文图片.png'),
  14. 'https://transcend.ringzle.com/web/assets/images/%E4%B8%AD%E6%96%87%E5%9B%BE%E7%89%87.png'
  15. )
  16. console.log('asset URL rules: PASS')