New Case Study:See how Anthropic automated 95% of dependency reviews with Socket.Learn More
Socket
Sign inDemoInstall
Socket

sass-true

Package Overview
Dependencies
Maintainers
1
Versions
27
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

sass-true - npm Package Compare versions

Comparing version 2.0.0-beta.1 to 2.0.0

eyeglass-exports.js

2

bower.json
{
"name": "true",
"version": "2.0.0.beta.1",
"version": "2.0.0",
"main": "sass/_true.scss",

@@ -5,0 +5,0 @@ "description": "Unit testing for Sass.",

True Changelog
==============
2.0 (unreleased)
----------------
2.0 (5/9/15)
------------
- Improve internal logic, and namespace private functions behind `_true-*`.

@@ -12,3 +12,2 @@ - Add `assert()`, `input`, and `expect` mixins for testing CSS output.

- Simplify output options down to single `$true-terminal-output` setting.
Defaults to `false` (required for libsass).

@@ -15,0 +14,0 @@

var _ = require('underscore');
var parseCss = require('css').parse;
var path = require('path');
var sass = require('node-sass');

@@ -13,3 +14,9 @@ var CssSelectorParser = require('css-selector-parser').CssSelectorParser;

var assert = require('assert');
var css = sass.renderSync(options);
var sassPath = path.join(__dirname, '..', 'sass');
if (options.includePaths) {
options.includePaths.push(sassPath);
} else {
options.includePaths = [sassPath];
}
var css = sass.renderSync(options).css.toString();
var modules = parse(css);

@@ -16,0 +23,0 @@

{
"name": "sass-true",
"version": "2.0.0-beta.1",
"version": "2.0.0",
"description": "Unit testing for Sass.",

@@ -19,5 +19,5 @@ "homepage": "http://ericsuzanne.com/true",

"dependencies": {
"node-sass": "~1.2.0",
"css": "~2.1.0",
"css-selector-parser": "~1.0.0",
"node-sass": "^3.0.0",
"underscore": "~1.7.0"

@@ -24,0 +24,0 @@ },

@@ -15,7 +15,3 @@ True

At this point
True can only test values (e.g. function returns),
not property/value output (e.g. mixin output).
Install

@@ -32,11 +28,81 @@ -------

bower install true
# npm module
npm install sass-true
```
Usage
-----
Command Line
------------
### In Sass
_This command-line tool uses Ruby
and the Ruby Sass compiler._
```scss
@import "true";
@include test-module('Utilities') {
// Testing Functions
@include test('Map Add [function]') {
$base: (one: 1, two: 1, three: 1);
$add: (one: 1, two: 2, three: -1);
$test: map-add($base, $add);
$expect: (one: 2, two: 3, three: 0);
@include assert-equal($test, $expect,
'Returns the sum of two numeric maps');
}
// Testing Mixins
@include test('Font Size [mixin]') {
@include assert('Outputs a font size and line height based on keyword.') {
@include input {
@include font-size(large);
}
@include expect {
font-size: 2rem;
line-height: 3rem;
}
}
}
}
// Optionally show summary report in CSS and/or the command line:
// - If you use Mocha, reporting to the command line is automatic.
// - if you use true-cli, report(terminal) is required for output.
@include report;
```
### With node-sass and Mocha (or other JS test runners)
1. Install `true` via npm (`npm install sass-true`).
2. Write some Sass tests in `test/test.scss` (see above).
3. Write a shim JS test file in `test/test_sass.js`:
```js
var path = require('path');
var true = require('sass-true');
var sassFile = path.join(__dirname, 'test.scss');
true.runSass({file: sassFile}, describe, it);
```
4. Run Mocha, and see your Sass tests reported as individual test results.
You can call `runSass` more than once, if you have multiple Sass test files you
want to run separately.
The first argument to `runSass` accepts the same options that node-sass'
`renderSync` function accepts. The only modification `runSass` makes is to add
True's sass path to the `includePaths` option, so `@import 'true';` works in
your Sass test file.
Any other JS test runner with equivalents to Mocha's `describe` and `it` should
be usable in the same way; just pass your test runner's `describe` and `it`
equivalents into `runSass`.
### With ruby-sass on the command line
```bash

@@ -55,3 +121,3 @@ true-cli [options] PATH

options:
color: true #enables colored output
color: true # enables colored output

@@ -67,34 +133,2 @@ # require ruby sass extension libraries

Usage
-----
```scss
@import "true";
@include test-module('Utilities') {
@include test('Map Add [function]') {
$base: (one: 1, two: 1, three: 1);
$add: (one: 1, two: 2, three: -1);
$test: map-add($base, $add);
$expect: (one: 2, two: 3, three: 0);
@include assert-equal($test, $expect,
'Returns the sum of two numeric maps');
}
@include test('Is Equal [function]') {
$test: is-equal(1, 1rem);
@include assert-equal($test, false,
'Returns false for equal numbers with different units.');
$test: is-equal(1, 1);
@include assert-equal($test, true,
'Returns true for numbers that are truely equal.');
}
}
@include report;
```
Settings

@@ -105,8 +139,6 @@ --------

`$true-terminal-output`
toggles output to the terminal on and off.
toggles output to the terminal on or off.
- `true` will display a final summary of your test results in the terminal,
and show detailed information on failing assertions.
*Required for `true-cli`.*
- `true` will show detailed information on failing assertions.
This is the default, and best for using `true-cli`.
- `false` to turn off all terminal output.
*Required for Libsass.*

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc