complately update relative path regexp
This commit is contained in:
@@ -5,6 +5,12 @@ import { absoluteToStylesheet } from '../src/snapshot';
|
||||
describe('absolute url to stylesheet', () => {
|
||||
const href = 'http://localhost/css/style.css';
|
||||
|
||||
it('cam handle relative path', () => {
|
||||
expect(absoluteToStylesheet('url(a.jpg)', href)).to.equal(
|
||||
`url('http://localhost/css/a.jpg')`,
|
||||
);
|
||||
});
|
||||
|
||||
it('can handle same level path', () => {
|
||||
expect(absoluteToStylesheet('url("./a.jpg")', href)).to.equal(
|
||||
`url('http://localhost/css/a.jpg')`,
|
||||
|
||||
Reference in New Issue
Block a user