Permalink
Browse files

[refs #133] adding initial setup and tests

[refs #133] strict mode

[refs #133] match indentation

[refs #133] consistent quotes

[refs #133] add test to npmignore

[refs #133] test oldIE option

[refs #133] tweaks

[refs #133] adding widths test (doesn't work currently and tweaking test desc)

[refs #133] typo

[refs #133] glob tests

[refs #133] indentation
  • Loading branch information...
1 parent 36c24d4 commit d8961cc09e6c0558fc8a504801bc09e76a162b99 @tymondesigns tymondesigns committed Aug 8, 2016
Showing with 148 additions and 1 deletion.
  1. +1 −0 .npmignore
  2. +6 −1 package.json
  3. +76 −0 test/_tools.font-size.scss
  4. +32 −0 test/_tools.rem.scss
  5. +24 −0 test/_utilities.widths.scss
  6. +9 −0 test/run.js
View
@@ -1,3 +1,4 @@
.editorconfig
bower.json
CONTRIBUTING.md
+test
View
@@ -4,7 +4,7 @@
"description": "Extensible, scalable, Sass-based, OOCSS framework for large and long-lasting UI projects.",
"main": "example.main.scss",
"scripts": {
- "test": "echo \"Error: no test specified\" && exit 1"
+ "test": "mocha test/run.js"
},
"repository": {
"type": "git",
@@ -31,5 +31,10 @@
"homepage": "https://github.com/inuitcss/inuitcss#readme",
"dependencies": {
"sass-mq": "^3.2.9"
+ },
+ "devDependencies": {
+ "glob": "^7.0.5",
+ "mocha": "^3.0.2",
+ "sass-true": "^2.1.3"
}
}
@@ -0,0 +1,76 @@
+@import "true";
+
+@import "../settings/settings.core";
+@import "../tools/tools.font-size";
+
+
+@mixin test-inuit-old-ie-before() {
+ $inuit-oldIE: true !global;
+}
+
+
+@include test-module("[mixin] inuit-font-size") {
+
+ @include test("it should output a font-size and line-height based on a given input") {
+
+ @include assert() {
+
+ @include output {
+ @include inuit-font-size(16px);
+ }
+
+ @include expect {
+ font-size: 1rem;
+ line-height: 1.5;
+ }
+ }
+ }
+
+ @include test("it should output a font-size and line-height when specifying a line-height") {
+
+ @include assert() {
+
+ @include output {
+ @include inuit-font-size(18px, 2);
+ }
+
+ @include expect {
+ font-size: 1.125rem;
+ line-height: 2;
+ }
+ }
+ }
+
+ @include test("it should output a font-size as important when passing true") {
+
+ @include assert() {
+
+ @include output {
+ @include inuit-font-size(21px, $important: true);
+ }
+
+ @include expect {
+ font-size: 1.3125rem !important;
+ line-height: 1.14286 !important;
+ }
+ }
+ }
+
+ @include test("it should output a font-size and line-height when supporting old ie") {
+ @include test-inuit-old-ie-before;
+
+ @include assert() {
+
+ @include output {
+ @include inuit-font-size(21px);
+ }
+
+ @include expect {
+ font-size: 21px;
+ font-size: 1.3125rem;
+ line-height: 1.14286;
+ }
+ }
+ }
+}
+
View
@@ -0,0 +1,32 @@
+@import "true";
+
+@import "../settings/settings.core";
+@import "../tools/tools.rem";
+
+
+@include test-module("[function] inuit-rem") {
+
+ @include test("it should convert a pixel value to it's rem equivalent") {
+
+ $test: inuit-rem(18px);
+ $expect: 1.125rem;
+ @include assert-equal($test, $expect, "Returns the rem equivalant for pixel value");
+ }
+}
+
+@include test-module("[mixin] inuit-rem") {
+
+ @include test("it should output a property with a rem value converted from a pixel value") {
+
+ @include assert() {
+
+ @include output {
+ @include inuit-rem(padding, 10px);
+ }
+
+ @include expect {
+ padding: 0.625rem;
+ }
+ }
+ }
+}
@@ -0,0 +1,24 @@
+@import "true";
+
+// @import "../utilities/utilities.widths";
+
+
+@include test-module("[mixin] widths") {
+
+ @include test("it should output fractional width classes for a given set of denominations") {
+
+ @include assert() {
+
+ @include output {
+ // @include inuit-widths(1 2 3);
+ }
+
+ @include expect {
+ // .u-1\/1 { width: 100%; }
+ // .u-1\/2 { width: 50%; }
+ // .u-1\/3 { width: 33.3333%; }
+ // .u-2\/3 { width: 66.6666%; }
+ }
+ }
+ }
+}
View
@@ -0,0 +1,9 @@
+'use strict';
+
+var sassTrue = require('sass-true');
+var glob = require('glob');
+
+// Run tests
+glob.sync('test/_*.scss').forEach(function (file) {
+ sassTrue.runSass({ file: file }, describe, it);
+});

0 comments on commit d8961cc

Please sign in to comment.