File tree 7 files changed +4071
-6461
lines changed
7 files changed +4071
-6461
lines changed Original file line number Diff line number Diff line change 1
- #! /bin/sh
2
- . " $( dirname " $0 " ) /_/husky.sh"
3
-
4
- npx --no-install commitlint --edit
1
+ npx --no-install commitlint --edit
Original file line number Diff line number Diff line change 2
2
// TEST //
3
3
// ============================================================================================= //
4
4
5
- @use " true" as * ;
5
+ @use " pkg:sass- true" as * ;
6
6
@use " ../index" as css ;
7
7
@use " ../custom-properties" ;
8
8
9
9
@include describe (" mixins" ) {
10
10
@include describe (" declaration()" ) {
11
- @include it (" Should return a css declaration." ) {
11
+ @include it (" Should return a CSS declaration." ) {
12
12
@include assert {
13
13
@include output (false) {
14
14
.foo {
24
24
}
25
25
}
26
26
27
- @include it (" Should return a css declaration with custom property." ) {
27
+ @include it (" Should return a CSS declaration with custom property." ) {
28
28
@include assert {
29
29
@include output (false) {
30
30
.test {
40
40
}
41
41
}
42
42
43
- @include it (" Should return a css declaration with `!important` option." ) {
43
+ @include it (" Should return a CSS declaration with `!important` option." ) {
44
44
@include assert {
45
45
@include output (false) {
46
46
.foo {
74
74
}
75
75
76
76
@include describe (" declaration() with custom properties" ) {
77
- @include it (" Should return a css declaration with custom property from `custom-properties.create()` function." ) {
77
+ @include it (" Should return a CSS declaration with custom property from `custom-properties.create()` function." ) {
78
78
@include assert {
79
79
@include output (false) {
80
80
.test {
90
90
}
91
91
}
92
92
93
- @include it (" Should return a css declaration with custom property from `custom-properties.create()` function with missing `--`." ) {
93
+ @include it (" Should return a CSS declaration with custom property from `custom-properties.create()` function with missing `--`." ) {
94
94
@include assert {
95
95
@include output (false) {
96
96
.test {
106
106
}
107
107
}
108
108
109
- @include it (" Should return a css declaration with `var()`." ) {
109
+ @include it (" Should return a CSS declaration with `var()`." ) {
110
110
@include assert {
111
111
@include output (false) {
112
112
.test {
122
122
}
123
123
}
124
124
125
- @include it (" Should return a css declaration with nested `var()`." ) {
125
+ @include it (" Should return a CSS declaration with nested `var()`." ) {
126
126
@include assert {
127
127
@include output (false) {
128
128
.test {
Original file line number Diff line number Diff line change 2
2
// TESTS //
3
3
// ============================================================================================= //
4
4
5
- const path = require ( 'path' ) ;
6
- const sassTrue = require ( 'sass-true' ) ;
7
- const glob = require ( 'glob' ) ;
8
-
9
- const sassTestFiles = glob . sync ( path . resolve ( process . cwd ( ) , './**/*.spec.scss' ) , {
10
- ignore : [
11
- '**/node_modules/**'
12
- ]
13
- } ) ;
5
+ import fs from 'fs' ;
6
+ import path from 'path' ;
7
+ import sassTrue from 'sass-true' ;
14
8
15
- sassTestFiles . forEach ( ( file ) => {
16
- sassTrue . runSass (
17
- {
18
- describe,
19
- it
20
- } , file ,
21
- {
22
- loadPaths : [
23
- 'node_modules'
24
- ]
9
+ function getScssTestFiles ( dir ) {
10
+ const results = [ ] ;
11
+ const entries = fs . readdirSync ( dir , {
12
+ withFileTypes : true
13
+ } ) ;
14
+
15
+ entries . forEach ( entry => {
16
+ const fullPath = path . join ( dir , entry . name ) ;
17
+
18
+ if ( entry . isDirectory ( ) && entry . name !== 'node_modules' ) {
19
+ results . push ( ...getScssTestFiles ( fullPath ) ) ;
20
+ }
21
+
22
+ if ( entry . isFile ( ) && entry . name . endsWith ( '.spec.scss' ) ) {
23
+ results . push ( fullPath ) ;
25
24
}
26
- ) ;
25
+ } ) ;
26
+
27
+ return results ;
28
+ }
29
+
30
+ const sassTestFiles = getScssTestFiles ( process . cwd ( ) ) ;
31
+
32
+ sassTestFiles . forEach ( ( file ) => {
33
+ sassTrue . runSass ( {
34
+ describe,
35
+ it
36
+ } , file , {
37
+ loadPaths : [
38
+ 'node_modules'
39
+ ]
40
+ } ) ;
27
41
} ) ;
Load Diff This file was deleted.
You can’t perform that action at this time.
0 commit comments