import 'mocha';
import * as chai from 'chai';
const should = chai.should();
const expect = chai.expect;
version = "2022-01-30"
let res = "/2022-01-30/images?$top=100&$filter=recordName eq 'R-00005593'"
#this works fine.
expect(res).to.match(/^/d{4}-d{2}-d{2}/images?$top=100&$filter=recordName eq 'R-d{8}'$/);
#but I want to try with a variable version for the date.
expect(res).to.match(/^/${version}/images?$top=100&$filter=recordName eq 'R-d{8}'$/);
这不起作用,如有任何建议,将不胜感激。
软件测试自学文章源自玩技e族-https://www.playezu.com/194024.html 文章源自玩技e族-https://www.playezu.com/194024.html