Skip to content

Commit

Permalink
npm init + testing dependencies
Browse files Browse the repository at this point in the history
  • Loading branch information
Yoannis Jamar committed Oct 2, 2016
0 parents commit 8acba83
Show file tree
Hide file tree
Showing 5 changed files with 112 additions and 0 deletions.
23 changes: 23 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@


# Exclude hidden OS files.
.DS_Store
._*
Thumbs.db

# dependencies
node_modules
bower_components

# Exclude IDE management files.
# Eclipse
.project
.settings
.buildpath
# Netbeans
netbeans
nbproject
# Komodo
*.kpf
# WebStorm
.idea
38 changes: 38 additions & 0 deletions package.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,38 @@
{
"name": "sass-tune",
"version": "0.1.0",
"description": "A configurable base stylesheet for all browsers and devices.",
"main": "index.js",
"directories": {
"test": "test"
},
"scripts": {
"test": "echo \"Error: no test specified\" && exit 1"
},
"repository": {
"type": "git",
"url": "git+https://github.com/yoannisj/sass-tune.git"
},
"keywords": [
"CSS",
"Sass",
"normalize.css",
"normalize.scss",
"fluidity",
"h5bp",
"responsive",
"boilerplate"
],
"author": "Yoannis Jamar <yoannis.j@gmail.com>",
"license": "ISC",
"bugs": {
"url": "https://github.com/yoannisj/sass-tune/issues"
},
"homepage": "https://github.com/yoannisj/sass-tune#readme",
"devDependencies": {
"mocha": "^3.1.0",
"node-sass": "^3.10.1",
"node-sass-import-once": "^1.2.0",
"sass-true": "^2.1.3"
}
}
27 changes: 27 additions & 0 deletions test/test.scss
Original file line number Diff line number Diff line change
@@ -0,0 +1,27 @@
// =============================================================================
// =TEST SASS
// =============================================================================

// import true's testing utilities
@import "true";

// WRITING TESTS
// -------------
// @include test-module($module-desc) { /* assertion tests */ }
// @include test($component-desc) { /* assertion tests */ }
// ---
// @include assert-true($assert, $behaviour-desc);
// @include assert-false($assert, $behaviour-desc);
// @include assert-equal($assert, $expected, $behaviour-desc);
// @include assert-unequal($assert, $expected, $behaviour-desc);
// ---
// @include assert($behaviour-desc) {
// @include input { /* tested sass */ }
// @inlcude expect { /* expected output */ }
// }

// Import your true tests here

// optionally report test's results in css and terminal
// (not needed when using Mocha)
@include report(true);
24 changes: 24 additions & 0 deletions test/test_sass.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
var path = require('path');
var sassTrue = require('sass-true');
var importOnce = require('node-sass-import-once');

// get path to test file
var sassFile = path.join(__dirname, 'test.scss');

// add 'stylesheets' and 'test' directories as 'includePaths' so included
// tests, modules and their dependencies can successfully be imported.
// list paths to bower dependencies to use as 'includePaths'.
var sassIncludePaths = [
'./stylesheets/',
'./test/',
'./bower_components/SassyLists/stylesheets/',
'./bower_components/sassy-maps/sass/'
];

// render the test's sass with sassTrue (includes path to true's scss)
// - use mocha's 'describe' and 'it' functions to run sass-true tests
sassTrue.runSass({
file: sassFile,
importer: importOnce,
includePaths: sassIncludePaths,
}, describe, it);
Empty file added test/tests/_tune-sass.scss
Empty file.

0 comments on commit 8acba83

Please sign in to comment.