Skip to content

Commit 029d90f

Browse files
committed
feat: turn on ava option, dumber now supports import 'a.less';
1 parent 2964bf1 commit 029d90f

7 files changed

Lines changed: 33 additions & 10 deletions

File tree

aurelia/src/app.html

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,13 @@
11
<template>
2+
<!-- @if css -->
23
<require from="./app.css"></require>
4+
<!-- @endif -->
5+
<!-- @if less -->
6+
<require from="./app.less"></require>
7+
<!-- @endif -->
8+
<!-- @if sass -->
9+
<require from="./app.scss"></require>
10+
<!-- @endif -->
311
<div class="app">
412
<h1>${message}</h1>
513
</div>

aurelia/test__if_jest_or_ava/setup.ext

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -10,4 +10,6 @@ globalize();
1010
// @if ava
1111
// ignore css modules
1212
require.extensions['.css'] = () => '';
13+
require.extensions['.less'] = () => '';
14+
require.extensions['.scss'] = () => '';
1315
// @endif

questions.js

Lines changed: 2 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -39,15 +39,8 @@ module.exports = [
3939
{value: 'jasmine', title: 'Jasmine', hint: 'Runs in browser, a behavior-driven testing framework.'},
4040
{value: 'mocha', title: 'Mocha + Chai', hint: 'Runs in browser, a feature-rich JavaScript test framework for node and browsers.'},
4141
{value: 'tape', title: 'Tape', hint: 'Runs in browser, tap-producing test harness for node and browsers.'},
42-
43-
// Disable ava for now, there is one small issue I got no solution so far.
44-
// When less/sass is chosen, `import './app.css';` throws out "Cannot find module" because
45-
// app.css is resolved to compiled result of app.less/app.scss, but in Nodejs env,
46-
// Nodejs doesn't know where to read module './app.css'.
47-
// jest has a workaround through moduleNameMapper, but ava relies on Nodejs itself to resolve module.
48-
49-
// {if: '!aurelia', value: 'ava', title: 'Ava + browser-env', hint: 'Runs in Node.js, simulates browser (browser-env). A test runner for Node.js with a concise API, detailed error output, embrace of new language features and process isolation that let you write tests more effectively.'},
50-
// {if: 'aurelia', value: 'ava', title: 'Ava', hint: 'Runs in Node.js, simulates browser (aurelia-pal-nodejs). A test runner for Node.js with a concise API, detailed error output, embrace of new language features and process isolation that let you write tests more effectively.'}
42+
{if: '!aurelia', value: 'ava', title: 'Ava + browser-env', hint: 'Runs in Node.js, simulates browser (browser-env). A test runner for Node.js with a concise API, detailed error output, embrace of new language features and process isolation that let you write tests more effectively.'},
43+
{if: 'aurelia', value: 'ava', title: 'Ava', hint: 'Runs in Node.js, simulates browser (aurelia-pal-nodejs). A test runner for Node.js with a concise API, detailed error output, embrace of new language features and process isolation that let you write tests more effectively.'}
5144
]
5245
},
5346
{

react/src/App.extx

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,15 @@ import React from "react";
1111
// all less files were transpiled to css files by
1212
// gulp-less before sending to dumber.
1313
// @endif
14+
// @if css
1415
import "./styles.css";
16+
// @endif
17+
// @if less
18+
import "./styles.less";
19+
// @endif
20+
// @if sass
21+
import "./styles.scss";
22+
// @endif
1523

1624
const App = () => (
1725
<div className="app">

react/test/setup.ext

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5,4 +5,6 @@ import 'regenerator-runtime/runtime';
55
// @if ava
66
// ignore css modules
77
require.extensions['.css'] = () => '';
8+
require.extensions['.less'] = () => '';
9+
require.extensions['.scss'] = () => '';
810
// @endif

vue/src__if_not_sfc/App.ext

Lines changed: 9 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,15 @@
1010
// all less files were transpiled to css files by
1111
// gulp-less before sending to dumber.
1212
// @endif
13-
import './App.css';
13+
// @if css
14+
import "./App.css";
15+
// @endif
16+
// @if less
17+
import "./App.less";
18+
// @endif
19+
// @if sass
20+
import "./App.scss";
21+
// @endif
1422

1523
export default {
1624
template: `

vue/test/setup.ext

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5,4 +5,6 @@ import 'regenerator-runtime/runtime';
55
// @if ava
66
// ignore css modules
77
require.extensions['.css'] = () => '';
8+
require.extensions['.less'] = () => '';
9+
require.extensions['.scss'] = () => '';
810
// @endif

0 commit comments

Comments
 (0)