mirror of
https://github.com/NativeScript/NativeScript.git
synced 2025-11-05 13:26:48 +08:00
chore: use vitest for unit testing plus workspace updates (#10662)
This commit is contained in:
@@ -1,5 +1,5 @@
|
||||
import { cssTreeParse } from './css-tree-parser';
|
||||
import { parse as reworkCssParse } from './reworkcss';
|
||||
import { parse as reworkCssParse } from './reworkcss.js';
|
||||
|
||||
describe('CssTreeParser', () => {
|
||||
it('basic selector', () => {
|
||||
|
||||
@@ -6,7 +6,7 @@ import { CSSNativeScript } from './CSSNativeScript';
|
||||
import * as fs from 'fs';
|
||||
import * as path from 'path';
|
||||
import * as shadyCss from 'shady-css-parser';
|
||||
import * as reworkCss from 'css';
|
||||
const reworkCss = await import('./reworkcss.js');
|
||||
|
||||
const parseCss: any = require('parse-css');
|
||||
const gonzales: any = require('gonzales');
|
||||
|
||||
@@ -54,7 +54,8 @@ export interface BackgroundPosition {
|
||||
text?: string;
|
||||
}
|
||||
|
||||
const urlRegEx = /\s*url\((?:(['"])([^\1]*)\1|([^)]*))\)\s*/gy;
|
||||
const urlRegEx = /\s*url\((?:(['"])(.*?)\1|([^)]*))\)\s*/gy;
|
||||
// const urlRegEx = /(?:^|\s*#[a-fA-F0-9]{3,6}\s*|^\s*)url\((['"]?)(.*?)\1\)\s*/gi;
|
||||
export function parseURL(text: string, start = 0): Parsed<URL> {
|
||||
urlRegEx.lastIndex = start;
|
||||
const result = urlRegEx.exec(text);
|
||||
|
||||
Reference in New Issue
Block a user