-
Notifications
You must be signed in to change notification settings - Fork 8
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
chore(SCSS): created skeleton for testing SCSS (#1521)
ISSUES CLOSED: #952
- Loading branch information
1 parent
47ff01d
commit cde99e3
Showing
26 changed files
with
432 additions
and
35 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,44 +1,43 @@ | ||
module.exports = { | ||
"globals": { | ||
"ts-jest": { | ||
"tsConfigFile": "./terminus-ui/tsconfig.spec.json", | ||
"ignoreCoverageForAllDecorators": true, | ||
globals: { | ||
'ts-jest': { | ||
tsConfigFile: './terminus-ui/tsconfig.spec.json', | ||
ignoreCoverageForAllDecorators: true, | ||
}, | ||
"__TRANSFORM_HTML__": true, | ||
'__TRANSFORM_HTML__': true, | ||
}, | ||
"transform": { | ||
"^.+\\.(ts|js|html)$": "<rootDir>/node_modules/jest-preset-angular/preprocessor.js", | ||
}, | ||
"testMatch": [ | ||
"<rootDir>/**/?(*.)spec.ts?(x)", | ||
transform: {'^.+\\.(ts|js|html)$': '<rootDir>/node_modules/jest-preset-angular/preprocessor.js' }, | ||
testMatch: [ | ||
'<rootDir>/**/?(*.)spec.ts?(x)', | ||
'<rootDir>/**/?(*.)test-sass.js?(x)', | ||
], | ||
"testPathIgnorePatterns": [ | ||
"<rootDir>/node_modules/", | ||
"<rootDir>/demo/app", | ||
testPathIgnorePatterns: [ | ||
'<rootDir>/node_modules/', | ||
'<rootDir>/demo/app', | ||
], | ||
"transformIgnorePatterns": [ | ||
"node_modules/(?!@ngrx)", | ||
transformIgnorePatterns: [ | ||
'node_modules/(?!@ngrx)', | ||
], | ||
"reporters": ["default", [ "jest-junit", { output: "./coverage/junit/report.xml" } ]], | ||
"clearMocks": true, | ||
"collectCoverageFrom": [ | ||
"terminus-ui/**/!(index|public-api|*.module|*.interface|*.constant|*.mock|*.d).ts", | ||
"!terminus-ui/**/testing/**" | ||
reporters: ['default', ['jest-junit', { output: './coverage/junit/report.xml' }]], | ||
clearMocks: true, | ||
collectCoverageFrom: [ | ||
'terminus-ui/**/!(index|public-api|*.module|*.interface|*.constant|*.mock|*.d).ts', | ||
'!terminus-ui/**/testing/**', | ||
], | ||
"moduleFileExtensions": [ | ||
"ts", | ||
"js", | ||
"html", | ||
moduleFileExtensions: [ | ||
'ts', | ||
'js', | ||
'html', | ||
], | ||
"coverageDirectory": "<rootDir>/coverage/", | ||
"setupFilesAfterEnv": [ | ||
"<rootDir>/tooling/jest-setup.ts", | ||
coverageDirectory: '<rootDir>/coverage/', | ||
setupFilesAfterEnv: [ | ||
'<rootDir>/tooling/jest-setup.ts', | ||
], | ||
"moduleNameMapper": { | ||
"app/(.*)": "<rootDir>/demo/app/$1", | ||
"assets/(.*)": "<rootDir>/demo/assets/$1", | ||
"environments/(.*)": "<rootDir>/demo/environments/$1", | ||
"^@terminus/ui(.*)$": "<rootDir>/terminus-ui$1/src/public-api.ts", | ||
"^@terminus/ui(.*)/testing$": "<rootDir>/terminus-ui$1/testing/src/public-api.ts", | ||
moduleNameMapper: { | ||
'app/(.*)': '<rootDir>/demo/app/$1', | ||
'assets/(.*)': '<rootDir>/demo/assets/$1', | ||
'environments/(.*)': '<rootDir>/demo/environments/$1', | ||
'^@terminus/ui(.*)$': '<rootDir>/terminus-ui$1/src/public-api.ts', | ||
'^@terminus/ui(.*)/testing$': '<rootDir>/terminus-ui$1/testing/src/public-api.ts', | ||
}, | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,28 @@ | ||
@import 'true'; | ||
@import './a11y'; | ||
|
||
@include describe ('a11y') { | ||
@include test ('should correctly render cdk-a11y') { | ||
@include assert { | ||
@include output { | ||
@include cdk-a11y(); | ||
} | ||
@include expect { | ||
.cdk-visually-hidden { | ||
-webkit-appearance: none; | ||
-moz-appearance: none; | ||
|
||
border: 0; | ||
clip: rect(0 0 0 0); | ||
height: 1px; | ||
margin: -1px; | ||
outline: 0; | ||
overflow: hidden; | ||
padding: 0; | ||
position: absolute; | ||
width: 1px; | ||
} | ||
} | ||
} | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,2 @@ | ||
@import 'true'; | ||
@import './animation'; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,2 @@ | ||
@import 'true'; | ||
@import './assets'; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,16 @@ | ||
@import 'true'; | ||
@import './breakpoints'; | ||
|
||
/* @include describe ('breakpoints') { | ||
@include test ('should correctly render bp') { | ||
@include assert { | ||
@include output { | ||
@include bp(layout-xs); | ||
} | ||
// is there a way to tests @media queries? | ||
@include expect { | ||
} | ||
} | ||
} | ||
} */ |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,27 @@ | ||
@import 'true'; | ||
@import './buttons'; | ||
|
||
@include describe ('button') { | ||
@include test ('should correctly render button-base') { | ||
@include assert { | ||
@include output { | ||
.button-test { | ||
@include button-base(); | ||
} | ||
} | ||
@include expect { | ||
.button-test { | ||
background-color: transparent; | ||
border: 0; | ||
cursor: pointer; | ||
outline: 0; | ||
text-align: center; | ||
} | ||
|
||
.button-test:focus { | ||
outline: 0; | ||
} | ||
} | ||
} | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,2 @@ | ||
@import 'true'; | ||
@import './card'; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,89 @@ | ||
@import 'true'; | ||
@import './color'; | ||
|
||
@include describe ('color') { | ||
@include test('should return the correct color based on palette and tone') { | ||
$test: color(warn, dark); | ||
$expect: #b55949; | ||
|
||
@include assert-equal($test, $expect); | ||
} | ||
|
||
/* @include test('should return the correct theme (this seems to fail due to class being added by true)') { | ||
@include assert{ | ||
@include output { | ||
@include theme-color(background-color); | ||
} | ||
@include expect { | ||
::ng-deep .u-theme--primary .test-output { | ||
background-color: #00538a; | ||
color: #fafafa; | ||
} | ||
::ng-deep .u-theme--primary .test-output[disabled] { | ||
background-color: #cecdd1; | ||
color: #999; | ||
} | ||
::ng-deep .u-theme--accent .test-output { | ||
background-color: #2f854d; | ||
color: #fafafa; | ||
} | ||
::ng-deep .u-theme--accent .test-output[disabled] { | ||
background-color: #cecdd1; | ||
color: #999; | ||
} | ||
::ng-deep .u-theme--error .test-output { | ||
background-color: #c8604d; | ||
color: #fafafa; | ||
} | ||
::ng-deep .u-theme--error .test-output[disabled] { | ||
background-color: #cecdd1; | ||
color: #999; | ||
} | ||
::ng-deep .u-theme--warn .test-output { | ||
background-color: #dea83b; | ||
color: #fafafa; | ||
} | ||
::ng-deep .u-theme--warn .test-output[disabled] { | ||
background-color: #cecdd1; | ||
color: #999; | ||
} | ||
::ng-deep .u-theme--highlight .test-output { | ||
background-color: #efe557; | ||
color: #302d35; | ||
} | ||
::ng-deep .u-theme--highlight .test-output[disabled] { | ||
background-color: #cecdd1; | ||
color: #999; | ||
} | ||
::ng-deep .u-theme--pure .test-output { | ||
background-color: #fafafa; | ||
} | ||
::ng-deep .u-theme--pure .test-output[disabled] { | ||
background-color: #cecdd1; | ||
color: #999; | ||
} | ||
::ng-deep .u-theme--utility .test-output { | ||
background-color: #999; | ||
color: #fafafa; | ||
} | ||
::ng-deep .u-theme--utility .test-output[disabled] { | ||
background-color: #cecdd1; | ||
color: #999; | ||
} | ||
} | ||
} | ||
} */ | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,2 @@ | ||
@import 'true'; | ||
@import './cursors'; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,2 @@ | ||
@import 'true'; | ||
@import './input-placeholder'; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,2 @@ | ||
@import 'true'; | ||
@import './layout'; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,2 @@ | ||
@import 'true'; | ||
@import './menu'; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,2 @@ | ||
@import 'true'; | ||
@import './opposite-direction'; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,2 @@ | ||
@import 'true'; | ||
@import './reset'; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,2 @@ | ||
@import 'true'; | ||
@import './shadows'; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,56 @@ | ||
@import 'true'; | ||
@import './spacing'; | ||
|
||
@include describe ('spacing') { | ||
@include describe ('default') { | ||
@include test('should return the correct default spacing') { | ||
$test: spacing(); | ||
$expect: 16px; | ||
|
||
@include assert-equal($test, $expect); | ||
} | ||
} | ||
|
||
@include describe ('small') { | ||
@include test('should return the correct small spacing') { | ||
$test1: spacing(small); | ||
$expect1: 12px; | ||
|
||
$test2: spacing(small, 1); | ||
$expect2: 8px; | ||
|
||
$test3: spacing(small, 2); | ||
$expect3: 4px; | ||
|
||
@include assert-equal($test1, $expect1); | ||
@include assert-equal($test2, $expect2); | ||
@include assert-equal($test3, $expect3); | ||
} | ||
} | ||
|
||
@include describe ('large') { | ||
@include test('should return the correct large spacing') { | ||
$test1: spacing(large); | ||
$expect1: 24px; | ||
|
||
$test2: spacing(large, 3); | ||
$expect2: 48px; | ||
|
||
$test3: spacing(large, 6); | ||
$expect3: 96px; | ||
|
||
@include assert-equal($test1, $expect1); | ||
@include assert-equal($test2, $expect2); | ||
@include assert-equal($test3, $expect3); | ||
} | ||
} | ||
|
||
@include describe('failures') { | ||
@include test('should fail with mismatched values') { | ||
$test: spacing(large, 2); | ||
$expect: 24px; | ||
|
||
@include assert-unequal($test, $expect); | ||
} | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,2 @@ | ||
@import 'true'; | ||
@import './theme'; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,2 @@ | ||
@import 'true'; | ||
@import './triangle'; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,2 @@ | ||
@import 'true'; | ||
@import './typography'; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,2 @@ | ||
@import 'true'; | ||
@import './z-index'; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,11 @@ | ||
const path = require('path'); | ||
const sassTrue = require('sass-true'); | ||
const glob = require('glob'); | ||
|
||
describe('Sass', () => { | ||
const sassTestFiles = glob.sync( | ||
path.resolve(process.cwd(), 'terminus-ui/**/*.spec.scss') | ||
) | ||
|
||
sassTestFiles.forEach(file => sassTrue.runSass({ file }, describe, test)) | ||
}) |
Oops, something went wrong.