Skip to content

Commit

Permalink
update deps: esbuild, typescript (withastro#2750)
Browse files Browse the repository at this point in the history
* update dep: typescript

* update dep: esbuild

* update types

* update types

* update dep: es-module-lexer

* update tests
  • Loading branch information
FredKSchott authored Mar 10, 2022
1 parent fe790fa commit ea0926d
Show file tree
Hide file tree
Showing 4 changed files with 12 additions and 14 deletions.
8 changes: 4 additions & 4 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -76,8 +76,8 @@
"common-ancestor-path": "^1.0.1",
"debug": "^4.3.3",
"eol": "^0.9.1",
"es-module-lexer": "^0.9.3",
"esbuild": "0.13.7",
"es-module-lexer": "^0.10.0",
"esbuild": "0.14.25",
"estree-walker": "^3.0.0",
"fast-glob": "^3.2.7",
"fast-xml-parser": "^4.0.0-beta.3",
Expand Down Expand Up @@ -119,14 +119,14 @@
"@types/common-ancestor-path": "^1.0.0",
"@types/connect": "^3.4.35",
"@types/debug": "^4.1.7",
"@types/estree": "^0.0.50",
"@types/estree": "^0.0.51",
"@types/mime": "^2.0.3",
"@types/mocha": "^9.0.0",
"@types/parse5": "^6.0.3",
"@types/resolve": "^1.20.1",
"@types/rimraf": "^3.0.2",
"@types/send": "^0.17.1",
"@types/yargs-parser": "^20.2.1",
"@types/yargs-parser": "^21.0.0",
"astro-scripts": "workspace:*",
"chai": "^4.3.4",
"cheerio": "^1.0.0-rc.10",
Expand Down
2 changes: 1 addition & 1 deletion src/cli/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -97,7 +97,7 @@ function resolveCommand(flags: Arguments): CLICommand {
} else if (flags.help) {
return 'help';
}
const cmd = flags._[2];
const cmd = flags._[2] as string;
const supportedCommands = new Set(['dev', 'build', 'preview', 'check']);
if (supportedCommands.has(cmd)) {
return cmd as 'dev' | 'build' | 'preview' | 'check';
Expand Down
12 changes: 5 additions & 7 deletions test/0-css.test.js
Original file line number Diff line number Diff line change
Expand Up @@ -96,12 +96,10 @@ describe('CSS', function () {
describe('JSX', () => {
it('.css', async () => {
const el = $('#react-css');

// 1. check HTML
expect(el.attr('class')).to.include('react-title');

// 2. check CSS
expect(bundledCSS).to.include('.react-title{');
expect(bundledCSS).to.include('.react-title');
});

it('.module.css', async () => {
Expand Down Expand Up @@ -196,7 +194,7 @@ describe('CSS', function () {
expect(el.attr('class')).to.include(moduleClass);

// 2. check CSS
expect(bundledCSS).to.include(`${moduleClass}{`);
expect(bundledCSS).to.match(new RegExp(`.${moduleClass}[^{]*{font-family:cursive}`));
});

it('<style lang="sass">', async () => {
Expand Down Expand Up @@ -230,7 +228,7 @@ describe('CSS', function () {
expect(el.attr('class')).to.include('svelte-css');

// 2. check CSS
expect(bundledCSS).to.match(new RegExp(`.svelte-css.${scopedClass}[^{]*{font-family:"Comic Sans MS"`));
expect(bundledCSS).to.match(new RegExp(`.svelte-css.${scopedClass}[^{]*{font-family:Comic Sans MS`));
});

it('<style lang="sass">', async () => {
Expand All @@ -242,7 +240,7 @@ describe('CSS', function () {
expect(el.attr('class')).to.include('svelte-sass');

// 2. check CSS
expect(bundledCSS).to.match(new RegExp(`.svelte-sass.${scopedClass}[^{]*{font-family:"Comic Sans MS"`));
expect(bundledCSS).to.match(new RegExp(`.svelte-sass.${scopedClass}[^{]*{font-family:Comic Sans MS`));
});

it('<style lang="scss">', async () => {
Expand All @@ -254,7 +252,7 @@ describe('CSS', function () {
expect(el.attr('class')).to.include('svelte-scss');

// 2. check CSS
expect(bundledCSS).to.match(new RegExp(`.svelte-scss.${scopedClass}[^{]*{font-family:"Comic Sans MS"`));
expect(bundledCSS).to.match(new RegExp(`.svelte-scss.${scopedClass}[^{]*{font-family:Comic Sans MS`));
});
});
});
Expand Down
4 changes: 2 additions & 2 deletions test/postcss.test.js
Original file line number Diff line number Diff line change
Expand Up @@ -31,11 +31,11 @@ describe('PostCSS', () => {
});

it('works in JSX', () => {
expect(bundledCSS).to.match(new RegExp(`.solid${PREFIXED_CSS}`));
expect(bundledCSS).to.match(new RegExp(`.solid[^{]*${PREFIXED_CSS}`));
});

it('works in Vue', () => {
expect(bundledCSS).to.match(new RegExp(`.vue${PREFIXED_CSS}`));
expect(bundledCSS).to.match(new RegExp(`.vue[^{]*${PREFIXED_CSS}`));
});

it('works in Svelte', () => {
Expand Down

0 comments on commit ea0926d

Please sign in to comment.