chore: use vitest for unit testing plus workspace updates (#10662)

This commit is contained in:
Nathan Walker
2025-01-12 11:52:13 -08:00
committed by GitHub
parent baced677f8
commit 3dec0a5e99
32 changed files with 4927 additions and 2931 deletions

View File

@@ -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', () => {

View File

@@ -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');

View File

@@ -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);