Skip to content

Adding True Tests #1

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
wants to merge 10 commits into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
7 changes: 7 additions & 0 deletions .travis.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
language: node_js
node_js:
- "6.0"
- "5.0"
- "4.0"
- "0.12"
script: npm test
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
# Frontline Sass
[![npm version](https://badge.fury.io/js/frontline-sass.svg)](https://badge.fury.io/js/frontline-sass)
[![npm version](https://badge.fury.io/js/frontline-sass.svg)](https://badge.fury.io/js/frontline-sass) [![Build Status](https://travis-ci.org/Threespot/frontline-sass.svg)](https://travis-ci.org/Threespot/frontline-sass)

Threespot's Sass framework

Expand Down
5 changes: 4 additions & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,8 @@
"homepage": "https://github.com/Threespot/frontline-sass",
"scripts": {
"gulp": "gulp",
"lint": "gulp sass-lint"
"lint": "gulp sass-lint",
"test": "mocha tests/test_sass.js --reporter spec"
},
"license": "MIT",
"devDependencies": {
Expand All @@ -41,6 +42,8 @@
"gulp-sass": "2.3.2",
"gulp-scss-lint": "0.4.0",
"js-yaml": "3.6.1",
"mocha": "^3.1.2",
"sass-true": "^2.1.3",
"sassdoc": "2.1.20"
}
}
2 changes: 1 addition & 1 deletion src/functions/_em.scss
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
/// Convert px to em
/// @group Main
/// @param {Number | Map} $values - Value or values to convert
/// @param {Number | List} $values - Value or values to convert
/// @param {Number} $context [$fs-base-font-size] - Base font size
/// @return {*} - Converted value or list of values
/// @require {variable} $fs-base-font-size - Base font size
Expand Down
145 changes: 0 additions & 145 deletions tests/_SassyTester.scss

This file was deleted.

74 changes: 0 additions & 74 deletions tests/_simple-test.scss

This file was deleted.

50 changes: 45 additions & 5 deletions tests/functions/_color.scss
Original file line number Diff line number Diff line change
@@ -1,5 +1,45 @@
// Color mixin test
@include run(test('fs-color', (
fs-color('red'): #ff4136,
fs-color('blue'): #0074d9
)));
// Import True
@import "true";
// Import Frontline
@import '../../src/_frontline.scss';

@include test-module('Function: fs-color') {

// Testing Color Function
@include test('returns a color from the $fs-colors map') {
$base: 'green';

$test: fs-color($base);
$expect: #2ecc40;
@include assert-equal($test, $expect,
'Returns a color from the global `fs-color map`');
}
}
/* END Module */


/* Before */
$new-colors: (
"brand": (
"red": #ff4136
)
);
$fs-colors-original: $fs-colors;
$fs-colors: map-merge($fs-colors, $new-colors);
/* Test */
@include test-module('Function: fs-color') {

// Testing Color Function
@include test('returns a color that has been added to the $fs-color map') {
$test: fs-color('brand', 'red');
$expect: #ff4136;
@include assert-equal($test, $expect,
'Returns a color that was added to the global `fs-color map`');
}
}
/* After */
$new-colors: null;
$fs-colors: $fs-colors-original;
/* END Module */

@include report;
29 changes: 29 additions & 0 deletions tests/functions/_em.scss
Original file line number Diff line number Diff line change
@@ -0,0 +1,29 @@
// Import True
@import "true";
// Import Frontline
@import '../../src/_frontline.scss';

/* Before */
/* Test */
@include test-module('Function: fs-em') {

@include test('converts a pixel value to em') {
$base: 16px;
$test: nth(fs-em(16px), 1); // pluck the first (and only) value from the list
$expect: 1em;
@include assert-equal($test, $expect,
'Returns a em value based on the base-font-size');
}

@include test('converts a list of pixel values to a list of em values') {
$base: 16px 20px;
$test: fs-em($base);
$expect: 1em 1.25em;
@include assert-equal($test, $expect,
'Returns a em value based on the base-font-size');
}
}
/* After */
/* END Module */

@include report;
Loading