]> git.ipfire.org Git - thirdparty/foundation/foundation-sites.git/commitdiff
Rework Sass unit testing file structure to make it far easier to add new tests by... feature/sass-unit-testing
authorBrett Mason <brettsmason@gmail.com>
Wed, 2 Aug 2017 11:23:22 +0000 (12:23 +0100)
committerBrett Mason <brettsmason@gmail.com>
Wed, 2 Aug 2017 11:23:22 +0000 (12:23 +0100)
test/sass/_breakpoint.scss
test/sass/_color.scss
test/sass/_components.scss
test/sass/_selector.scss
test/sass/_unit.scss
test/sass/_value.scss
test/sass/test.scss [new file with mode: 0644]
test/sass/test_sass.js

index d013ac47dfd84048f21bfd1ab161c261922567e2..d1b3bc991c946d3a5a4965324f8bc65453256bfd 100755 (executable)
@@ -1,8 +1,3 @@
-@import "true";
-
-@import '../../scss/util/unit';
-@import '../../scss/util/breakpoint';
-
 @include test-module('Breakpoint') {
 
   @include test('Breakpoint (Named to Em) [function]') {
index 854ca54b1296326d48db1208946f54a491c39261..b6fd0cc3f658af8481eb974c862b1f9cef93d7d4 100755 (executable)
@@ -1,8 +1,3 @@
-@import "true";
-
-@import '../../scss/global';
-@import '../../scss/util/color';
-
 @include test-module('Color') {
 
   @include test('Foreground (Black) [function]') {
index 0e8bf0e705eba143252e61ed41cc7665fea2e7b8..9161a55d947411e8194ddfc3d0a833b457a7c558 100644 (file)
@@ -1,10 +1,3 @@
-@import "true";
-
-@import '../../scss/util/math';
-@import '../../scss/global';
-@import '../../scss/components/responsive-embed';
-@import '../../scss/grid/grid';
-
 @include test-module('Components') {
 
   @include test('Ratio to Percentage [function]') {
index 8e47ae7caf29331d599d8e80b4c35b4e23ac7255..1d5b21ca0ceaf5719b427d80ce4a10a9a5b36694 100755 (executable)
@@ -1,9 +1,5 @@
-@import "true";
-
-@import '../../scss/util/selector';
-
 @include test-module('Selector') {
-  
+
        @include test('Selector [function]') {
          $test: #{text-inputs(text password)};
          $expect: "[type='text'], [type='password']";
index dc66b96908d8df1115b47971daaebb4b1799509d..92bfcd9e63c97aa7c46eda4db16c7f6a51f61c4b 100755 (executable)
@@ -1,7 +1,3 @@
-@import "true";
-
-@import '../../scss/util/unit';
-
 @include test-module('Units') {
 
   // Strip Units
@@ -32,7 +28,7 @@
     @include assert-equal($test, $expect,
       'Converts an arbitrary number of values into rem equivalents');
   }
-  
+
   // Breakpoint to Em
   @include test('Breakpoint To Em [function]') {
     $expect: 1em;
index 200d79f2388ddbad62f01186571e576fa654491a..a7049e309d01848265e8a102abc0c45ed837cd26 100755 (executable)
@@ -1,8 +1,3 @@
-@import "true";
-
-@import '../../scss/util/unit';
-@import '../../scss/util/value';
-
 @include test-module('Value') {
 
   @include test('Value (Not Falsey) [function]') {
       ),
     );
     $expect: 'three';
-    
+
     @include assert-equal(map-deep-get($map, one, two), $expect,
       'Gets a value from a nested map');
   }
       one: 'two'
     );
     $expect: 'two';
-    
+
     @include assert-equal(map-safe-get($map, one), $expect,
       'Safely return a value from a map');
   }
diff --git a/test/sass/test.scss b/test/sass/test.scss
new file mode 100644 (file)
index 0000000..01e4186
--- /dev/null
@@ -0,0 +1,13 @@
+// Sass True
+@import 'true';
+
+// All of Foundation
+@import '../../scss/foundation';
+
+// Individual tests
+@import 'breakpoint';
+@import 'color';
+@import 'components';
+@import 'selector';
+@import 'unit';
+@import 'value';
index 38d0e5d9eea325987a74d30720561ee081df3abb..2441e850d8912c968807426a152db526073f8541 100644 (file)
@@ -1,18 +1,8 @@
 var path = require('path');
 var sassTrue = require('sass-true');
 
-// Test Files
-var breakpointFile = path.join(__dirname, '_breakpoint.scss');
-var colorFile = path.join(__dirname, '_color.scss');
-var selectorFile = path.join(__dirname, '_selector.scss');
-var unitFile = path.join(__dirname, '_unit.scss');
-var valueFile = path.join(__dirname, '_value.scss');
-var componentsFile = path.join(__dirname, '_components.scss');
+// Test file
+var sassFile = path.join(__dirname, 'test.scss');
 
-// Run Tests
-sassTrue.runSass({file: breakpointFile}, describe, it);
-sassTrue.runSass({file: colorFile}, describe, it);
-sassTrue.runSass({file: selectorFile}, describe, it);
-sassTrue.runSass({file: unitFile}, describe, it);
-sassTrue.runSass({file: valueFile}, describe, it);
-sassTrue.runSass({file: componentsFile}, describe, it);
\ No newline at end of file
+// Run tests
+sassTrue.runSass({file: sassFile}, describe, it);