Comparing version 4.0.0 to 5.0.0
@@ -1,7 +0,19 @@ | ||
True Changelog | ||
============== | ||
# True Changelog | ||
## 5.0.0 (06/03/19) | ||
4.0.0 (04/09/18) | ||
---------------- | ||
- BREAKING: Update API for `runSass`, which now accepts two arguments: a | ||
`sassOptions` object and a `trueOptions` object. | ||
- BREAKING: Drop support for node < 8 | ||
- Add docs and testing for usage with Jest | ||
[#135](https://github.com/oddbird/true/issues/135) | ||
- Add `sass` option to `runSass` for passing a different Sass implementation | ||
than `node-sass` [#137](https://github.com/oddbird/true/issues/137) | ||
- Remove `node-sass` from `peerDependencies` | ||
- Fix deprecated use of `assert.fail` | ||
[#138](https://github.com/oddbird/true/issues/138) | ||
- Update dev dependencies | ||
## 4.0.0 (04/09/18) | ||
- BREAKING: Move `node-sass` to `peerDependencies` | ||
@@ -11,5 +23,4 @@ - Update dependencies | ||
## 3.1.0 (03/06/18) | ||
3.1.0 (03/06/18) | ||
---------------- | ||
- NEW: Add `contains()` mixin for more minute output comparisons. | ||
@@ -19,20 +30,16 @@ Works the same as `expect()`, but doesn't require a complete match. | ||
## 3.0.2 (10/6/17) | ||
3.0.2 (10/6/17) | ||
--------------- | ||
- Dependency updates | ||
## 3.0.1 (9/13/17) | ||
3.0.1 (9/13/17) | ||
--------------- | ||
- Update docs | ||
## 3.0.0 (8/26/17) | ||
3.0.0 (8/26/17) | ||
--------------- | ||
- Update dependencies & release | ||
## 3.0.0-beta.1 (6/1/17) | ||
3.0.0-beta.1 (6/1/17) | ||
--------------------- | ||
- Added `describe` and `it` mixins, | ||
@@ -64,5 +71,4 @@ as alias for `test-module` and `test` respectively. | ||
## 2.2.2 (4/11/17) | ||
2.2.2 (4/11/17) | ||
--------------- | ||
- `assert-true` returns false on empty strings and lists | ||
@@ -72,5 +78,4 @@ - `assert-false` returns true on empty strings and lists | ||
## 2.2.1 (2/7/17) | ||
2.2.1 (2/7/17) | ||
-------------- | ||
- Output CSS context around Mocha parsing errors. | ||
@@ -84,16 +89,13 @@ - Added `$fail-on-error` argument to `report()` mixin. | ||
## 2.1.4 (12/22/16) | ||
2.1.4 (12/22/16) | ||
---------------- | ||
- Fix default assertion messages | ||
- Upgrade dependencies | ||
## 2.0.2 (5/13/15) | ||
2.0.2 (5/13/15) | ||
--------------- | ||
- Fixes debug inspector. | ||
## 2.0.1 (5/9/15) | ||
2.0.1 (5/9/15) | ||
-------------- | ||
- Improve internal logic, and namespace private functions behind `_true-*`. | ||
@@ -103,14 +105,12 @@ - Add `assert()`, `input`, and `expect` mixins for testing CSS output. | ||
- Add Mocha JS integration. | ||
— Create NPM package. | ||
— Create NPM package. | ||
- Simplify output options down to single `$true-terminal-output` setting. | ||
- Add eyeglass support. | ||
## 1.0.1 (10/18/14) | ||
1.0.1 (10/18/14) | ||
---------------- | ||
- LibSass 3.0 compatability. | ||
## 1.0.0 (10/3/14) | ||
1.0.0 (10/3/14) | ||
--------------- | ||
- Add command-line interface: `true-cli <path-to-file>` | ||
@@ -121,5 +121,4 @@ - Use `-s` flag for silent output | ||
## 0.2.0 (7/15/14) | ||
0.2.0 (7/15/14) | ||
--------------- | ||
- Simplified reporting in both terminal and CSS. | ||
@@ -137,33 +136,27 @@ - Remove `default-module-output`, `$default-test-output` and `$default-final-output`. | ||
## 0.1.5 (6/10/13) | ||
0.1.5 (6/10/13) | ||
--------------- | ||
- Append actual results to custom failure messages. | ||
## 0.1.4 (6/9/13) | ||
0.1.4 (6/9/13) | ||
-------------- | ||
- Null result is considered a failure. | ||
- Allow output to be turned off for certain modules/tests/assertions. | ||
## 0.1.3 (6/7/13) | ||
0.1.3 (6/7/13) | ||
-------------- | ||
- Nest assertions within `test() {}` named tests. | ||
- Cleaner css output. | ||
## 0.1.2 (6/7/13) | ||
0.1.2 (6/7/13) | ||
-------------- | ||
- Use nesting for modules with `test-module() {}` | ||
- Added failure message argument to all assertions. | ||
## 0.1.1 (6/6/13) | ||
0.1.1 (6/6/13) | ||
-------------- | ||
- Fix bug in `lib/true.rb` compass plugin registration. | ||
## 0.1.0 (6/6/13) | ||
0.1.0 (6/6/13) | ||
-------------- | ||
- `assert-true()`, `assert-false()`, `assert-equal()`, and `assert-unequal()`. | ||
@@ -170,0 +163,0 @@ - `pass()` and `fail()` for tracking and reporting individual results. |
@@ -1,3 +0,2 @@ | ||
Contributing to True | ||
==================== | ||
# Contributing to True | ||
@@ -12,6 +11,4 @@ True exists because of your contributions. | ||
## Pull Requests | ||
Pull Requests | ||
------------- | ||
We use the `master` branch for production-ready code, | ||
@@ -25,3 +22,3 @@ and side-branches for everything in-progress | ||
- Include any appropriate unit tests, | ||
and make sure all tests are passing (`npm test`) | ||
and make sure all tests are passing (`yarn test`) | ||
- Add your changes to the [changelog](CHANGELOG.md) | ||
@@ -32,6 +29,4 @@ - Update or write appropriate [SassDoc](http://sassdoc.com/) | ||
## Development | ||
Development | ||
----------- | ||
Set up your dev environment | ||
@@ -44,6 +39,4 @@ with the appropriate dependencies: | ||
## Committing | ||
Committing | ||
---------- | ||
Linting, testing, and documentation | ||
@@ -53,3 +46,3 @@ should be done before every commit: | ||
``` | ||
npm run commit | ||
yarn commit | ||
``` | ||
@@ -63,7 +56,7 @@ | ||
# test with mocha/true | ||
npm test | ||
# test with mocha/jest and true | ||
yarn test | ||
# compile docs | ||
npm run sassdoc | ||
yarn sassdoc | ||
``` | ||
@@ -70,0 +63,0 @@ |
@@ -1,7 +0,10 @@ | ||
(window.webpackJsonp=window.webpackJsonp||[]).push([[5],{11:function(e,n){e.exports={colors:{"brand-colors":{"brand-orange":"#c75000","brand-blue":"#0d7fa5","brand-pink":"#aa0e5c"},"neutral-colors":{"light-gray":"#dedede",gray:"#555b5e",black:"#3b4042"},"theme-colors":{"theme-dark":"#0d7fa5","theme-light":"#cfe5ed",background:"#fff",text:"#3b4042","text-light":"#555b5e",action:"#aa0e5c",focus:"#0d7fa5",underline:"#eac3d6",border:"#555b5e","border-light":"#dedede",shadow:"rgba(85, 91, 94, 0.5)",callout:"#cfe5ed",slight:"#fafcfd",code:"#0d7fa5","code-shadow":"rgba(13, 127, 165, 0.2)"},"system-colors":{"contrast-light":"#fff","contrast-dark":"#3b4042"},"hljs-colors":{"hljs-comment":"#93a1a1","hljs-green":"#859900","hljs-cyan":"#2aa198","hljs-blue":"#268bd2","hljs-yellow":"#b58900","hljs-orange":"#cb4b16","hljs-red":"#dc322f","hljs-formula":"#eee8d5"},"demo-colors":{"brand-blue":"#0d7fa5","brand-pink":"#e2127a"},"demo-noncolors":{"light-gray":"#dedede",gray:"#555b5e",black:"#3b4042"}},ratios:{"text-ratios":{"line-height":1.4},"demo-ratios":{"line-height":1.4}},sizes:{"root-sizes":{root:"18px",responsive:"calc(1em + 0.125vw)",large:"calc(1rem + 0.5vw)",small:"0.9rem"},"text-sizes":{reset:"1rem",h1:"calc(1rem + 2vw)",h2:"calc(1rem + 1vw)",h3:"calc(1rem + 0.5vw)",quote:"calc(1rem + 0.5vw)",code:"0.9rem",footer:"0.9rem",search:"0.9rem"},"spacing-sizes":{rhythm:"1.4rem",gutter:"1.4rem","gutter-plus":"2.1rem","double-gutter":"2.8rem","flex-gutter":"calc(0.7rem + 2.5vw)",spacer:"calc(4.2rem + 2.5vw)","gutter-minus":"1.05rem",shim:"0.7rem","half-shim":"0.35rem","quarter-shim":"0.175rem"},"pattern-sizes":{"nav-underline":"4px","nav-icon":"28px","arrow-border":"8px","arrow-depth":"0.7rem","arrow-side":"1.4rem","font-preview":"24em","specimen-aa":"4.2rem","color-preview":"16em","color-swatch":"5.6rem","footer-logo":"2.8rem"},"layout-sizes":{page:"50rem","item-break":"40em","page-break":"50em","nav-break":"65em"},"demo-sizes":{root:"18px",xlarge:"3rem"}},fonts:{sans:{name:"Source Sans Pro",source:"https://fonts.google.com/specimen/Source+Sans+Pro",stack:["Helvetica Neue","Helvetica","Arial","sans-serif"]},code:{name:"Source Code Pro",source:"https://fonts.google.com/specimen/Source+Code+Pro",stack:["Consolas","Menlo","Monaco","Lucida Console","Liberation Mono","DejaVu Sans Mono","Bitstream Vera Sans Mono","Courier New","monospace","sans-serif"]},"demo-cdn":{name:"Source Code Pro",source:"https://fonts.google.com/specimen/Source+Code+Pro",stack:["Consolas","Menlo","Courier New","monospace","sans-serif"]},"demo-local":{name:"rockingham",normal:{path:"rockingham/rockingham-regular-webfont",local:"rockingham-regular-webfont"},bold:"rockingham/rockingham-bold-webfont",italic:"rockingham/rockingham-italic-webfont","bold italic":"rockingham/rockingham-bolditalic-webfont",stack:"fantasy",formats:["woff2","woff","ttf"]}}}},18:function(e,n,t){"use strict";(function(e){t.d(n,"c",function(){return i}),t.d(n,"a",function(){return s}),t.d(n,"b",function(){return o});var a=t(11),r=t.n(a),i=function(){var n=e("body");n.on("toggle:close",'[data-toggle="button"]',function(){var n=e(this).attr("aria-controls"),t=e('[data-target-id="'.concat(n,'"]'));e('[data-toggle="button"][aria-controls="'.concat(n,'"][aria-pressed="true"]')).attr("aria-pressed","false"),t.trigger("target:close")}),n.on("toggle:open",'[data-toggle="button"]',function(){var n=e(this),t=n.attr("aria-controls"),a=e('[data-target-id="'.concat(t,'"]')),r=e('[data-toggle="button"][aria-controls="'.concat(t,'"]')).not(n);n.data("toggle-synced")?r.filter('[data-toggle-synced="true"]').attr("aria-pressed","true"):r.filter('[aria-pressed="true"]').attr("aria-pressed","false"),n.attr("aria-pressed","true"),a.trigger("target:open")}),n.on("target:close",'[data-toggle="target"]',function(n){var t=e(this);e(n.target).is(t)&&t.attr("aria-expanded","false")});var t=function(n){var t=n.attr("data-target-id"),a=e('[data-toggle="button"][aria-controls="'.concat(t,'"][aria-pressed="true"]'));a.length?a.trigger("toggle:close"):n.trigger("target:close")};n.on("target:open",'[data-toggle="target"]',function(n){var t=e(this);e(n.target).is(t)&&t.attr("aria-expanded","true")}),n.on("click",'[data-toggle="button"]',function(n){n.preventDefault();var t=e(this);"true"===t.attr("aria-pressed")?t.trigger("toggle:close"):t.trigger("toggle:open")}),n.on("click",'[data-toggle="close"]',function(n){n.preventDefault();var a=e('[data-target-id="'.concat(e(this).attr("aria-controls"),'"]'));t(a)});n.on("click",function(n){e('[data-toggle="target"][aria-expanded="true"][data-auto-closing="true"]').each(function(a,r){!function(e,n){var a=n.attr("data-target-id"),r=e.closest('[aria-controls="'.concat(a,'"]')).length,i=document.contains(e.get(0)),s=!e.closest(n).length,o=n.attr("data-auto-closing-exception"),l=!!o&&e.closest(o).length;!r&&(n.data("auto-closing-on-any-click")||i&&s&&!l)&&t(n)}(e(n.target),e(r))})})},s=function(){var n=function(n){n.contentWindow.document.body&&(n.height=e(n.contentWindow.document).outerHeight(!0))},t=function(){e("iframe").each(function(){n(this)})};t(),e("iframe").on("load",function(){n(this)}),e(window).on("resize",t)},o=function(){var n=r.a&&r.a.sizes&&r.a.sizes["layout-sizes"]&&r.a.sizes["layout-sizes"]["nav-break"];if(n){var t=e("#nav"),a=e('[aria-controls="nav"]'),i=window.matchMedia("(min-width: ".concat(n,")")),s=function(e){e.matches?t.attr("aria-expanded","true"):t.attr("aria-expanded",a.attr("aria-pressed"))};s(i),i.addListener(s)}}}).call(this,t(16))},49:function(e,n,t){ | ||
/*! highlight.js v9.12.0 | BSD3 License | git.io/hljslicense */ | ||
!function(e){"object"==typeof window&&window||"object"==typeof self&&self;(function(e){var n=[],t=Object.keys,a={},r={},i=/^(no-?highlight|plain|text)$/i,s=/\blang(?:uage)?-([\w-]+)\b/i,o=/((^(<[^>]+>|\t|)+|(?:\n)))/gm,l="</span>",c={classPrefix:"hljs-",tabReplace:null,useBR:!1,languages:void 0};function d(e){return e.replace(/&/g,"&").replace(/</g,"<").replace(/>/g,">")}function g(e){return e.nodeName.toLowerCase()}function u(e,n){var t=e&&e.exec(n);return t&&0===t.index}function m(e){return i.test(e)}function b(e){var n,t={},a=Array.prototype.slice.call(arguments,1);for(n in e)t[n]=e[n];return a.forEach(function(e){for(n in e)t[n]=e[n]}),t}function f(e){var n=[];return function e(t,a){for(var r=t.firstChild;r;r=r.nextSibling)3===r.nodeType?a+=r.nodeValue.length:1===r.nodeType&&(n.push({event:"start",offset:a,node:r}),a=e(r,a),g(r).match(/br|hr|img|input/)||n.push({event:"stop",offset:a,node:r}));return a}(e,0),n}function p(e){function n(e){return e&&e.source||e}function a(t,a){return new RegExp(n(t),"m"+(e.case_insensitive?"i":"")+(a?"g":""))}!function r(i,s){if(i.compiled)return;i.compiled=!0;i.keywords=i.keywords||i.beginKeywords;if(i.keywords){var o={},l=function(n,t){e.case_insensitive&&(t=t.toLowerCase()),t.split(" ").forEach(function(e){var t=e.split("|");o[t[0]]=[n,t[1]?Number(t[1]):1]})};"string"==typeof i.keywords?l("keyword",i.keywords):t(i.keywords).forEach(function(e){l(e,i.keywords[e])}),i.keywords=o}i.lexemesRe=a(i.lexemes||/\w+/,!0);s&&(i.beginKeywords&&(i.begin="\\b("+i.beginKeywords.split(" ").join("|")+")\\b"),i.begin||(i.begin=/\B|\b/),i.beginRe=a(i.begin),i.end||i.endsWithParent||(i.end=/\B|\b/),i.end&&(i.endRe=a(i.end)),i.terminator_end=n(i.end)||"",i.endsWithParent&&s.terminator_end&&(i.terminator_end+=(i.end?"|":"")+s.terminator_end));i.illegal&&(i.illegalRe=a(i.illegal));null==i.relevance&&(i.relevance=1);i.contains||(i.contains=[]);i.contains=Array.prototype.concat.apply([],i.contains.map(function(e){return function(e){e.variants&&!e.cached_variants&&(e.cached_variants=e.variants.map(function(n){return b(e,{variants:null},n)}));return e.cached_variants||e.endsWithParent&&[b(e)]||[e]}("self"===e?i:e)}));i.contains.forEach(function(e){r(e,i)});i.starts&&r(i.starts,s);var c=i.contains.map(function(e){return e.beginKeywords?"\\.?("+e.begin+")\\.?":e.begin}).concat([i.terminator_end,i.illegal]).map(n).filter(Boolean);i.terminators=c.length?a(c.join("|"),!0):{exec:function(){return null}}}(e)}function h(e,n,t,r){function i(e,n){var t=b.case_insensitive?n[0].toLowerCase():n[0];return e.keywords.hasOwnProperty(t)&&e.keywords[t]}function s(e,n,t,a){var r=a?"":c.classPrefix,i='<span class="'+r,s=t?"":l;return(i+=e+'">')+n+s}function o(){_+=null!=E.subLanguage?function(){var e="string"==typeof E.subLanguage;if(e&&!a[E.subLanguage])return d(y);var n=e?h(E.subLanguage,y,!0,v[E.subLanguage]):w(y,E.subLanguage.length?E.subLanguage:void 0);E.relevance>0&&(x+=n.relevance);e&&(v[E.subLanguage]=n.top);return s(n.language,n.value,!1,!0)}():function(){var e,n,t,a;if(!E.keywords)return d(y);a="",n=0,E.lexemesRe.lastIndex=0,t=E.lexemesRe.exec(y);for(;t;)a+=d(y.substring(n,t.index)),(e=i(E,t))?(x+=e[1],a+=s(e[0],d(t[0]))):a+=d(t[0]),n=E.lexemesRe.lastIndex,t=E.lexemesRe.exec(y);return a+d(y.substr(n))}(),y=""}function g(e){_+=e.className?s(e.className,"",!0):"",E=Object.create(e,{parent:{value:E}})}function m(e,n){if(y+=e,null==n)return o(),0;var a=function(e,n){var t,a;for(t=0,a=n.contains.length;t<a;t++)if(u(n.contains[t].beginRe,e))return n.contains[t]}(n,E);if(a)return a.skip?y+=n:(a.excludeBegin&&(y+=n),o(),a.returnBegin||a.excludeBegin||(y=n)),g(a),a.returnBegin?0:n.length;var r=function e(n,t){if(u(n.endRe,t)){for(;n.endsParent&&n.parent;)n=n.parent;return n}if(n.endsWithParent)return e(n.parent,t)}(E,n);if(r){var i=E;i.skip?y+=n:(i.returnEnd||i.excludeEnd||(y+=n),o(),i.excludeEnd&&(y=n));do{E.className&&(_+=l),E.skip||(x+=E.relevance),E=E.parent}while(E!==r.parent);return r.starts&&g(r.starts),i.returnEnd?0:n.length}if(function(e,n){return!t&&u(n.illegalRe,e)}(n,E))throw new Error('Illegal lexeme "'+n+'" for mode "'+(E.className||"<unnamed>")+'"');return y+=n,n.length||1}var b=N(e);if(!b)throw new Error('Unknown language: "'+e+'"');p(b);var f,E=r||b,v={},_="";for(f=E;f!==b;f=f.parent)f.className&&(_=s(f.className,"",!0)+_);var y="",x=0;try{for(var M,O,k=0;E.terminators.lastIndex=k,M=E.terminators.exec(n);)O=m(n.substring(k,M.index),M[0]),k=M.index+O;for(m(n.substr(k)),f=E;f.parent;f=f.parent)f.className&&(_+=l);return{relevance:x,value:_,language:e,top:E}}catch(e){if(e.message&&-1!==e.message.indexOf("Illegal"))return{relevance:0,value:d(n)};throw e}}function w(e,n){n=n||c.languages||t(a);var r={relevance:0,value:d(e)},i=r;return n.filter(N).forEach(function(n){var t=h(n,e,!1);t.language=n,t.relevance>i.relevance&&(i=t),t.relevance>r.relevance&&(i=r,r=t)}),i.language&&(r.second_best=i),r}function E(e){return c.tabReplace||c.useBR?e.replace(o,function(e,n){return c.useBR&&"\n"===e?"<br>":c.tabReplace?n.replace(/\t/g,c.tabReplace):""}):e}function v(e){var t,a,i,o,l,u=function(e){var n,t,a,r,i=e.className+" ";if(i+=e.parentNode?e.parentNode.className:"",t=s.exec(i))return N(t[1])?t[1]:"no-highlight";for(i=i.split(/\s+/),n=0,a=i.length;n<a;n++)if(m(r=i[n])||N(r))return r}(e);m(u)||(c.useBR?(t=document.createElementNS("http://www.w3.org/1999/xhtml","div")).innerHTML=e.innerHTML.replace(/\n/g,"").replace(/<br[ \/]*>/g,"\n"):t=e,l=t.textContent,i=u?h(u,l,!0):w(l),(a=f(t)).length&&((o=document.createElementNS("http://www.w3.org/1999/xhtml","div")).innerHTML=i.value,i.value=function(e,t,a){var r=0,i="",s=[];function o(){return e.length&&t.length?e[0].offset!==t[0].offset?e[0].offset<t[0].offset?e:t:"start"===t[0].event?e:t:e.length?e:t}function l(e){i+="<"+g(e)+n.map.call(e.attributes,function(e){return" "+e.nodeName+'="'+d(e.value).replace('"',""")+'"'}).join("")+">"}function c(e){i+="</"+g(e)+">"}function u(e){("start"===e.event?l:c)(e.node)}for(;e.length||t.length;){var m=o();if(i+=d(a.substring(r,m[0].offset)),r=m[0].offset,m===e){s.reverse().forEach(c);do{u(m.splice(0,1)[0]),m=o()}while(m===e&&m.length&&m[0].offset===r);s.reverse().forEach(l)}else"start"===m[0].event?s.push(m[0].node):s.pop(),u(m.splice(0,1)[0])}return i+d(a.substr(r))}(a,f(o),l)),i.value=E(i.value),e.innerHTML=i.value,e.className=function(e,n,t){var a=n?r[n]:t,i=[e.trim()];e.match(/\bhljs\b/)||i.push("hljs");-1===e.indexOf(a)&&i.push(a);return i.join(" ").trim()}(e.className,u,i.language),e.result={language:i.language,re:i.relevance},i.second_best&&(e.second_best={language:i.second_best.language,re:i.second_best.relevance}))}function _(){if(!_.called){_.called=!0;var e=document.querySelectorAll("pre code");n.forEach.call(e,v)}}function N(e){return e=(e||"").toLowerCase(),a[e]||a[r[e]]}e.highlight=h,e.highlightAuto=w,e.fixMarkup=E,e.highlightBlock=v,e.configure=function(e){c=b(c,e)},e.initHighlighting=_,e.initHighlightingOnLoad=function(){addEventListener("DOMContentLoaded",_,!1),addEventListener("load",_,!1)},e.registerLanguage=function(n,t){var i=a[n]=t(e);i.aliases&&i.aliases.forEach(function(e){r[e]=n})},e.listLanguages=function(){return t(a)},e.getLanguage=N,e.inherit=b,e.IDENT_RE="[a-zA-Z]\\w*",e.UNDERSCORE_IDENT_RE="[a-zA-Z_]\\w*",e.NUMBER_RE="\\b\\d+(\\.\\d+)?",e.C_NUMBER_RE="(-?)(\\b0[xX][a-fA-F0-9]+|(\\b\\d+(\\.\\d*)?|\\.\\d+)([eE][-+]?\\d+)?)",e.BINARY_NUMBER_RE="\\b(0b[01]+)",e.RE_STARTERS_RE="!|!=|!==|%|%=|&|&&|&=|\\*|\\*=|\\+|\\+=|,|-|-=|/=|/|:|;|<<|<<=|<=|<|===|==|=|>>>=|>>=|>=|>>>|>>|>|\\?|\\[|\\{|\\(|\\^|\\^=|\\||\\|=|\\|\\||~",e.BACKSLASH_ESCAPE={begin:"\\\\[\\s\\S]",relevance:0},e.APOS_STRING_MODE={className:"string",begin:"'",end:"'",illegal:"\\n",contains:[e.BACKSLASH_ESCAPE]},e.QUOTE_STRING_MODE={className:"string",begin:'"',end:'"',illegal:"\\n",contains:[e.BACKSLASH_ESCAPE]},e.PHRASAL_WORDS_MODE={begin:/\b(a|an|the|are|I'm|isn't|don't|doesn't|won't|but|just|should|pretty|simply|enough|gonna|going|wtf|so|such|will|you|your|they|like|more)\b/},e.COMMENT=function(n,t,a){var r=e.inherit({className:"comment",begin:n,end:t,contains:[]},a||{});return r.contains.push(e.PHRASAL_WORDS_MODE),r.contains.push({className:"doctag",begin:"(?:TODO|FIXME|NOTE|BUG|XXX):",relevance:0}),r},e.C_LINE_COMMENT_MODE=e.COMMENT("//","$"),e.C_BLOCK_COMMENT_MODE=e.COMMENT("/\\*","\\*/"),e.HASH_COMMENT_MODE=e.COMMENT("#","$"),e.NUMBER_MODE={className:"number",begin:e.NUMBER_RE,relevance:0},e.C_NUMBER_MODE={className:"number",begin:e.C_NUMBER_RE,relevance:0},e.BINARY_NUMBER_MODE={className:"number",begin:e.BINARY_NUMBER_RE,relevance:0},e.CSS_NUMBER_MODE={className:"number",begin:e.NUMBER_RE+"(%|em|ex|ch|rem|vw|vh|vmin|vmax|cm|mm|in|pt|pc|px|deg|grad|rad|turn|s|ms|Hz|kHz|dpi|dpcm|dppx)?",relevance:0},e.REGEXP_MODE={className:"regexp",begin:/\//,end:/\/[gimuy]*/,illegal:/\n/,contains:[e.BACKSLASH_ESCAPE,{begin:/\[/,end:/\]/,relevance:0,contains:[e.BACKSLASH_ESCAPE]}]},e.TITLE_MODE={className:"title",begin:e.IDENT_RE,relevance:0},e.UNDERSCORE_TITLE_MODE={className:"title",begin:e.UNDERSCORE_IDENT_RE,relevance:0},e.METHOD_GUARD={begin:"\\.\\s*"+e.UNDERSCORE_IDENT_RE,relevance:0},e.registerLanguage("bash",function(e){var n={className:"variable",variants:[{begin:/\$[\w\d#@][\w\d_]*/},{begin:/\$\{(.*?)}/}]},t={className:"string",begin:/"/,end:/"/,contains:[e.BACKSLASH_ESCAPE,n,{className:"variable",begin:/\$\(/,end:/\)/,contains:[e.BACKSLASH_ESCAPE]}]};return{aliases:["sh","zsh"],lexemes:/\b-?[a-z\._]+\b/,keywords:{keyword:"if then else elif fi for while in do done case esac function",literal:"true false",built_in:"break cd continue eval exec exit export getopts hash pwd readonly return shift test times trap umask unset alias bind builtin caller command declare echo enable help let local logout mapfile printf read readarray source type typeset ulimit unalias set shopt autoload bg bindkey bye cap chdir clone comparguments compcall compctl compdescribe compfiles compgroups compquote comptags comptry compvalues dirs disable disown echotc echoti emulate fc fg float functions getcap getln history integer jobs kill limit log noglob popd print pushd pushln rehash sched setcap setopt stat suspend ttyctl unfunction unhash unlimit unsetopt vared wait whence where which zcompile zformat zftp zle zmodload zparseopts zprof zpty zregexparse zsocket zstyle ztcp",_:"-ne -eq -lt -gt -f -d -e -s -l -a"},contains:[{className:"meta",begin:/^#![^\n]+sh\s*$/,relevance:10},{className:"function",begin:/\w[\w\d_]*\s*\(\s*\)\s*\{/,returnBegin:!0,contains:[e.inherit(e.TITLE_MODE,{begin:/\w[\w\d_]*/})],relevance:0},e.HASH_COMMENT_MODE,t,{className:"string",begin:/'/,end:/'/},n]}}),e.registerLanguage("css",function(e){var n={begin:/[A-Z\_\.\-]+\s*:/,returnBegin:!0,end:";",endsWithParent:!0,contains:[{className:"attribute",begin:/\S/,end:":",excludeEnd:!0,starts:{endsWithParent:!0,excludeEnd:!0,contains:[{begin:/[\w-]+\(/,returnBegin:!0,contains:[{className:"built_in",begin:/[\w-]+/},{begin:/\(/,end:/\)/,contains:[e.APOS_STRING_MODE,e.QUOTE_STRING_MODE]}]},e.CSS_NUMBER_MODE,e.QUOTE_STRING_MODE,e.APOS_STRING_MODE,e.C_BLOCK_COMMENT_MODE,{className:"number",begin:"#[0-9A-Fa-f]+"},{className:"meta",begin:"!important"}]}}]};return{case_insensitive:!0,illegal:/[=\/|'\$]/,contains:[e.C_BLOCK_COMMENT_MODE,{className:"selector-id",begin:/#[A-Za-z0-9_-]+/},{className:"selector-class",begin:/\.[A-Za-z0-9_-]+/},{className:"selector-attr",begin:/\[/,end:/\]/,illegal:"$"},{className:"selector-pseudo",begin:/:(:)?[a-zA-Z0-9\_\-\+\(\)"'.]+/},{begin:"@(font-face|page)",lexemes:"[a-z-]+",keywords:"font-face page"},{begin:"@",end:"[{;]",illegal:/:/,contains:[{className:"keyword",begin:/\w+/},{begin:/\s/,endsWithParent:!0,excludeEnd:!0,relevance:0,contains:[e.APOS_STRING_MODE,e.QUOTE_STRING_MODE,e.CSS_NUMBER_MODE]}]},{className:"selector-tag",begin:"[a-zA-Z-][a-zA-Z0-9_-]*",relevance:0},{begin:"{",end:"}",illegal:/\S/,contains:[e.C_BLOCK_COMMENT_MODE,n]}]}}),e.registerLanguage("xml",function(e){var n={endsWithParent:!0,illegal:/</,relevance:0,contains:[{className:"attr",begin:"[A-Za-z0-9\\._:-]+",relevance:0},{begin:/=\s*/,relevance:0,contains:[{className:"string",endsParent:!0,variants:[{begin:/"/,end:/"/},{begin:/'/,end:/'/},{begin:/[^\s"'=<>`]+/}]}]}]};return{aliases:["html","xhtml","rss","atom","xjb","xsd","xsl","plist"],case_insensitive:!0,contains:[{className:"meta",begin:"<!DOCTYPE",end:">",relevance:10,contains:[{begin:"\\[",end:"\\]"}]},e.COMMENT("\x3c!--","--\x3e",{relevance:10}),{begin:"<\\!\\[CDATA\\[",end:"\\]\\]>",relevance:10},{begin:/<\?(php)?/,end:/\?>/,subLanguage:"php",contains:[{begin:"/\\*",end:"\\*/",skip:!0}]},{className:"tag",begin:"<style(?=\\s|>|$)",end:">",keywords:{name:"style"},contains:[n],starts:{end:"</style>",returnEnd:!0,subLanguage:["css","xml"]}},{className:"tag",begin:"<script(?=\\s|>|$)",end:">",keywords:{name:"script"},contains:[n],starts:{end:"<\/script>",returnEnd:!0,subLanguage:["actionscript","javascript","handlebars","xml"]}},{className:"meta",variants:[{begin:/<\?xml/,end:/\?>/,relevance:10},{begin:/<\?\w+/,end:/\?>/}]},{className:"tag",begin:"</?",end:"/?>",contains:[{className:"name",begin:/[^\/><\s]+/,relevance:0},n]}]}}),e.registerLanguage("django",function(e){var n={begin:/\|[A-Za-z]+:?/,keywords:{name:"truncatewords removetags linebreaksbr yesno get_digit timesince random striptags filesizeformat escape linebreaks length_is ljust rjust cut urlize fix_ampersands title floatformat capfirst pprint divisibleby add make_list unordered_list urlencode timeuntil urlizetrunc wordcount stringformat linenumbers slice date dictsort dictsortreversed default_if_none pluralize lower join center default truncatewords_html upper length phone2numeric wordwrap time addslashes slugify first escapejs force_escape iriencode last safe safeseq truncatechars localize unlocalize localtime utc timezone"},contains:[e.QUOTE_STRING_MODE,e.APOS_STRING_MODE]};return{aliases:["jinja"],case_insensitive:!0,subLanguage:"xml",contains:[e.COMMENT(/\{%\s*comment\s*%}/,/\{%\s*endcomment\s*%}/),e.COMMENT(/\{#/,/#}/),{className:"template-tag",begin:/\{%/,end:/%}/,contains:[{className:"name",begin:/\w+/,keywords:{name:"comment endcomment load templatetag ifchanged endifchanged if endif firstof for endfor ifnotequal endifnotequal widthratio extends include spaceless endspaceless regroup ifequal endifequal ssi now with cycle url filter endfilter debug block endblock else autoescape endautoescape csrf_token empty elif endwith static trans blocktrans endblocktrans get_static_prefix get_media_prefix plural get_current_language language get_available_languages get_current_language_bidi get_language_info get_language_info_list localize endlocalize localtime endlocaltime timezone endtimezone get_current_timezone verbatim"},starts:{endsWithParent:!0,keywords:"in by as",contains:[n],relevance:0}}]},{className:"template-variable",begin:/\{\{/,end:/}}/,contains:[n]}]}}),e.registerLanguage("javascript",function(e){var n="[A-Za-z$_][0-9A-Za-z$_]*",t={keyword:"in of if for while finally var new function do return void else break catch instanceof with throw case default try this switch continue typeof delete let yield const export super debugger as async await static import from as",literal:"true false null undefined NaN Infinity",built_in:"eval isFinite isNaN parseFloat parseInt decodeURI decodeURIComponent encodeURI encodeURIComponent escape unescape Object Function Boolean Error EvalError InternalError RangeError ReferenceError StopIteration SyntaxError TypeError URIError Number Math Date String RegExp Array Float32Array Float64Array Int16Array Int32Array Int8Array Uint16Array Uint32Array Uint8Array Uint8ClampedArray ArrayBuffer DataView JSON Intl arguments require module console window document Symbol Set Map WeakSet WeakMap Proxy Reflect Promise"},a={className:"number",variants:[{begin:"\\b(0[bB][01]+)"},{begin:"\\b(0[oO][0-7]+)"},{begin:e.C_NUMBER_RE}],relevance:0},r={className:"subst",begin:"\\$\\{",end:"\\}",keywords:t,contains:[]},i={className:"string",begin:"`",end:"`",contains:[e.BACKSLASH_ESCAPE,r]};r.contains=[e.APOS_STRING_MODE,e.QUOTE_STRING_MODE,i,a,e.REGEXP_MODE];var s=r.contains.concat([e.C_BLOCK_COMMENT_MODE,e.C_LINE_COMMENT_MODE]);return{aliases:["js","jsx"],keywords:t,contains:[{className:"meta",relevance:10,begin:/^\s*['"]use (strict|asm)['"]/},{className:"meta",begin:/^#!/,end:/$/},e.APOS_STRING_MODE,e.QUOTE_STRING_MODE,i,e.C_LINE_COMMENT_MODE,e.C_BLOCK_COMMENT_MODE,a,{begin:/[{,]\s*/,relevance:0,contains:[{begin:n+"\\s*:",returnBegin:!0,relevance:0,contains:[{className:"attr",begin:n,relevance:0}]}]},{begin:"("+e.RE_STARTERS_RE+"|\\b(case|return|throw)\\b)\\s*",keywords:"return throw case",contains:[e.C_LINE_COMMENT_MODE,e.C_BLOCK_COMMENT_MODE,e.REGEXP_MODE,{className:"function",begin:"(\\(.*?\\)|"+n+")\\s*=>",returnBegin:!0,end:"\\s*=>",contains:[{className:"params",variants:[{begin:n},{begin:/\(\s*\)/},{begin:/\(/,end:/\)/,excludeBegin:!0,excludeEnd:!0,keywords:t,contains:s}]}]},{begin:/</,end:/(\/\w+|\w+\/)>/,subLanguage:"xml",contains:[{begin:/<\w+\s*\/>/,skip:!0},{begin:/<\w+/,end:/(\/\w+|\w+\/)>/,skip:!0,contains:[{begin:/<\w+\s*\/>/,skip:!0},"self"]}]}],relevance:0},{className:"function",beginKeywords:"function",end:/\{/,excludeEnd:!0,contains:[e.inherit(e.TITLE_MODE,{begin:n}),{className:"params",begin:/\(/,end:/\)/,excludeBegin:!0,excludeEnd:!0,contains:s}],illegal:/\[|%/},{begin:/\$[(.]/},e.METHOD_GUARD,{className:"class",beginKeywords:"class",end:/[{;=]/,excludeEnd:!0,illegal:/[:"\[\]]/,contains:[{beginKeywords:"extends"},e.UNDERSCORE_TITLE_MODE]},{beginKeywords:"constructor",end:/\{/,excludeEnd:!0}],illegal:/#(?!!)/}}),e.registerLanguage("json",function(e){var n={literal:"true false null"},t=[e.QUOTE_STRING_MODE,e.C_NUMBER_MODE],a={end:",",endsWithParent:!0,excludeEnd:!0,contains:t,keywords:n},r={begin:"{",end:"}",contains:[{className:"attr",begin:/"/,end:/"/,contains:[e.BACKSLASH_ESCAPE],illegal:"\\n"},e.inherit(a,{begin:/:/})],illegal:"\\S"},i={begin:"\\[",end:"\\]",contains:[e.inherit(a)],illegal:"\\S"};return t.splice(t.length,0,r,i),{contains:t,keywords:n,illegal:"\\S"}}),e.registerLanguage("markdown",function(e){return{aliases:["md","mkdown","mkd"],contains:[{className:"section",variants:[{begin:"^#{1,6}",end:"$"},{begin:"^.+?\\n[=-]{2,}$"}]},{begin:"<",end:">",subLanguage:"xml",relevance:0},{className:"bullet",begin:"^([*+-]|(\\d+\\.))\\s+"},{className:"strong",begin:"[*_]{2}.+?[*_]{2}"},{className:"emphasis",variants:[{begin:"\\*.+?\\*"},{begin:"_.+?_",relevance:0}]},{className:"quote",begin:"^>\\s+",end:"$"},{className:"code",variants:[{begin:"^```w*s*$",end:"^```s*$"},{begin:"`.+?`"},{begin:"^( {4}|\t)",end:"$",relevance:0}]},{begin:"^[-\\*]{3,}",end:"$"},{begin:"\\[.+?\\][\\(\\[].*?[\\)\\]]",returnBegin:!0,contains:[{className:"string",begin:"\\[",end:"\\]",excludeBegin:!0,returnEnd:!0,relevance:0},{className:"link",begin:"\\]\\(",end:"\\)",excludeBegin:!0,excludeEnd:!0},{className:"symbol",begin:"\\]\\[",end:"\\]",excludeBegin:!0,excludeEnd:!0}],relevance:10},{begin:/^\[[^\n]+\]:/,returnBegin:!0,contains:[{className:"symbol",begin:/\[/,end:/\]/,excludeBegin:!0,excludeEnd:!0},{className:"link",begin:/:\s*/,end:/$/,excludeBegin:!0}]}]}}),e.registerLanguage("scss",function(e){var n={className:"variable",begin:"(\\$[a-zA-Z-][a-zA-Z0-9_-]*)\\b"},t={className:"number",begin:"#[0-9A-Fa-f]+"};return e.CSS_NUMBER_MODE,e.QUOTE_STRING_MODE,e.APOS_STRING_MODE,e.C_BLOCK_COMMENT_MODE,{case_insensitive:!0,illegal:"[=/|']",contains:[e.C_LINE_COMMENT_MODE,e.C_BLOCK_COMMENT_MODE,{className:"selector-id",begin:"\\#[A-Za-z0-9_-]+",relevance:0},{className:"selector-class",begin:"\\.[A-Za-z0-9_-]+",relevance:0},{className:"selector-attr",begin:"\\[",end:"\\]",illegal:"$"},{className:"selector-tag",begin:"\\b(a|abbr|acronym|address|area|article|aside|audio|b|base|big|blockquote|body|br|button|canvas|caption|cite|code|col|colgroup|command|datalist|dd|del|details|dfn|div|dl|dt|em|embed|fieldset|figcaption|figure|footer|form|frame|frameset|(h[1-6])|head|header|hgroup|hr|html|i|iframe|img|input|ins|kbd|keygen|label|legend|li|link|map|mark|meta|meter|nav|noframes|noscript|object|ol|optgroup|option|output|p|param|pre|progress|q|rp|rt|ruby|samp|script|section|select|small|span|strike|strong|style|sub|sup|table|tbody|td|textarea|tfoot|th|thead|time|title|tr|tt|ul|var|video)\\b",relevance:0},{begin:":(visited|valid|root|right|required|read-write|read-only|out-range|optional|only-of-type|only-child|nth-of-type|nth-last-of-type|nth-last-child|nth-child|not|link|left|last-of-type|last-child|lang|invalid|indeterminate|in-range|hover|focus|first-of-type|first-line|first-letter|first-child|first|enabled|empty|disabled|default|checked|before|after|active)"},{begin:"::(after|before|choices|first-letter|first-line|repeat-index|repeat-item|selection|value)"},n,{className:"attribute",begin:"\\b(z-index|word-wrap|word-spacing|word-break|width|widows|white-space|visibility|vertical-align|unicode-bidi|transition-timing-function|transition-property|transition-duration|transition-delay|transition|transform-style|transform-origin|transform|top|text-underline-position|text-transform|text-shadow|text-rendering|text-overflow|text-indent|text-decoration-style|text-decoration-line|text-decoration-color|text-decoration|text-align-last|text-align|tab-size|table-layout|right|resize|quotes|position|pointer-events|perspective-origin|perspective|page-break-inside|page-break-before|page-break-after|padding-top|padding-right|padding-left|padding-bottom|padding|overflow-y|overflow-x|overflow-wrap|overflow|outline-width|outline-style|outline-offset|outline-color|outline|orphans|order|opacity|object-position|object-fit|normal|none|nav-up|nav-right|nav-left|nav-index|nav-down|min-width|min-height|max-width|max-height|mask|marks|margin-top|margin-right|margin-left|margin-bottom|margin|list-style-type|list-style-position|list-style-image|list-style|line-height|letter-spacing|left|justify-content|initial|inherit|ime-mode|image-orientation|image-resolution|image-rendering|icon|hyphens|height|font-weight|font-variant-ligatures|font-variant|font-style|font-stretch|font-size-adjust|font-size|font-language-override|font-kerning|font-feature-settings|font-family|font|float|flex-wrap|flex-shrink|flex-grow|flex-flow|flex-direction|flex-basis|flex|filter|empty-cells|display|direction|cursor|counter-reset|counter-increment|content|column-width|column-span|column-rule-width|column-rule-style|column-rule-color|column-rule|column-gap|column-fill|column-count|columns|color|clip-path|clip|clear|caption-side|break-inside|break-before|break-after|box-sizing|box-shadow|box-decoration-break|bottom|border-width|border-top-width|border-top-style|border-top-right-radius|border-top-left-radius|border-top-color|border-top|border-style|border-spacing|border-right-width|border-right-style|border-right-color|border-right|border-radius|border-left-width|border-left-style|border-left-color|border-left|border-image-width|border-image-source|border-image-slice|border-image-repeat|border-image-outset|border-image|border-color|border-collapse|border-bottom-width|border-bottom-style|border-bottom-right-radius|border-bottom-left-radius|border-bottom-color|border-bottom|border|background-size|background-repeat|background-position|background-origin|background-image|background-color|background-clip|background-attachment|background-blend-mode|background|backface-visibility|auto|animation-timing-function|animation-play-state|animation-name|animation-iteration-count|animation-fill-mode|animation-duration|animation-direction|animation-delay|animation|align-self|align-items|align-content)\\b",illegal:"[^\\s]"},{begin:"\\b(whitespace|wait|w-resize|visible|vertical-text|vertical-ideographic|uppercase|upper-roman|upper-alpha|underline|transparent|top|thin|thick|text|text-top|text-bottom|tb-rl|table-header-group|table-footer-group|sw-resize|super|strict|static|square|solid|small-caps|separate|se-resize|scroll|s-resize|rtl|row-resize|ridge|right|repeat|repeat-y|repeat-x|relative|progress|pointer|overline|outside|outset|oblique|nowrap|not-allowed|normal|none|nw-resize|no-repeat|no-drop|newspaper|ne-resize|n-resize|move|middle|medium|ltr|lr-tb|lowercase|lower-roman|lower-alpha|loose|list-item|line|line-through|line-edge|lighter|left|keep-all|justify|italic|inter-word|inter-ideograph|inside|inset|inline|inline-block|inherit|inactive|ideograph-space|ideograph-parenthesis|ideograph-numeric|ideograph-alpha|horizontal|hidden|help|hand|groove|fixed|ellipsis|e-resize|double|dotted|distribute|distribute-space|distribute-letter|distribute-all-lines|disc|disabled|default|decimal|dashed|crosshair|collapse|col-resize|circle|char|center|capitalize|break-word|break-all|bottom|both|bolder|bold|block|bidi-override|below|baseline|auto|always|all-scroll|absolute|table|table-cell)\\b"},{begin:":",end:";",contains:[n,t,e.CSS_NUMBER_MODE,e.QUOTE_STRING_MODE,e.APOS_STRING_MODE,{className:"meta",begin:"!important"}]},{begin:"@",end:"[{;]",keywords:"mixin include extend for if else each while charset import debug media page content font-face namespace warn",contains:[n,e.QUOTE_STRING_MODE,e.APOS_STRING_MODE,t,e.CSS_NUMBER_MODE,{begin:"\\s[A-Za-z0-9_.-]+",relevance:0}]}]}}),e.registerLanguage("shell",function(e){return{aliases:["console"],contains:[{className:"meta",begin:"^\\s{0,3}[\\w\\d\\[\\]()@-]*[>%$#]",starts:{end:"$",subLanguage:"bash"}}]}}),e.registerLanguage("ruby",function(e){var n="[a-zA-Z_]\\w*[!?=]?|[-+~]\\@|<<|>>|=~|===?|<=>|[<>]=?|\\*\\*|[-/+%^&*~`|]|\\[\\]=?",t={keyword:"and then defined module in return redo if BEGIN retry end for self when next until do begin unless END rescue else break undef not super class case require yield alias while ensure elsif or include attr_reader attr_writer attr_accessor",literal:"true false nil"},a={className:"doctag",begin:"@[A-Za-z]+"},r={begin:"#<",end:">"},i=[e.COMMENT("#","$",{contains:[a]}),e.COMMENT("^\\=begin","^\\=end",{contains:[a],relevance:10}),e.COMMENT("^__END__","\\n$")],s={className:"subst",begin:"#\\{",end:"}",keywords:t},o={className:"string",contains:[e.BACKSLASH_ESCAPE,s],variants:[{begin:/'/,end:/'/},{begin:/"/,end:/"/},{begin:/`/,end:/`/},{begin:"%[qQwWx]?\\(",end:"\\)"},{begin:"%[qQwWx]?\\[",end:"\\]"},{begin:"%[qQwWx]?{",end:"}"},{begin:"%[qQwWx]?<",end:">"},{begin:"%[qQwWx]?/",end:"/"},{begin:"%[qQwWx]?%",end:"%"},{begin:"%[qQwWx]?-",end:"-"},{begin:"%[qQwWx]?\\|",end:"\\|"},{begin:/\B\?(\\\d{1,3}|\\x[A-Fa-f0-9]{1,2}|\\u[A-Fa-f0-9]{4}|\\?\S)\b/},{begin:/<<(-?)\w+$/,end:/^\s*\w+$/}]},l={className:"params",begin:"\\(",end:"\\)",endsParent:!0,keywords:t},c=[o,r,{className:"class",beginKeywords:"class module",end:"$|;",illegal:/=/,contains:[e.inherit(e.TITLE_MODE,{begin:"[A-Za-z_]\\w*(::\\w+)*(\\?|\\!)?"}),{begin:"<\\s*",contains:[{begin:"("+e.IDENT_RE+"::)?"+e.IDENT_RE}]}].concat(i)},{className:"function",beginKeywords:"def",end:"$|;",contains:[e.inherit(e.TITLE_MODE,{begin:n}),l].concat(i)},{begin:e.IDENT_RE+"::"},{className:"symbol",begin:e.UNDERSCORE_IDENT_RE+"(\\!|\\?)?:",relevance:0},{className:"symbol",begin:":(?!\\s)",contains:[o,{begin:n}],relevance:0},{className:"number",begin:"(\\b0[0-7_]+)|(\\b0x[0-9a-fA-F_]+)|(\\b[1-9][0-9_]*(\\.[0-9_]+)?)|[0_]\\b",relevance:0},{begin:"(\\$\\W)|((\\$|\\@\\@?)(\\w+))"},{className:"params",begin:/\|/,end:/\|/,keywords:t},{begin:"("+e.RE_STARTERS_RE+"|unless)\\s*",keywords:"unless",contains:[r,{className:"regexp",contains:[e.BACKSLASH_ESCAPE,s],illegal:/\n/,variants:[{begin:"/",end:"/[a-z]*"},{begin:"%r{",end:"}[a-z]*"},{begin:"%r\\(",end:"\\)[a-z]*"},{begin:"%r!",end:"![a-z]*"},{begin:"%r\\[",end:"\\][a-z]*"}]}].concat(i),relevance:0}].concat(i);s.contains=c,l.contains=c;var d=[{begin:/^\s*=>/,starts:{end:"$",contains:c}},{className:"meta",begin:"^([>?]>|[\\w#]+\\(\\w+\\):\\d+:\\d+>|(\\w+-)?\\d+\\.\\d+\\.\\d(p\\d+)?[^>]+>)",starts:{end:"$",contains:c}}];return{aliases:["rb","gemspec","podspec","thor","irb"],keywords:t,illegal:/\/\*/,contains:i.concat(d).concat(c)}}),e.registerLanguage("yaml",function(e){var n="[a-zA-Z_][\\w\\-]*",t={className:"attr",variants:[{begin:"^[ \\-]*"+n+":"},{begin:'^[ \\-]*"'+n+'":'},{begin:"^[ \\-]*'"+n+"':"}]},a={className:"string",relevance:0,variants:[{begin:/'/,end:/'/},{begin:/"/,end:/"/},{begin:/\S+/}],contains:[e.BACKSLASH_ESCAPE,{className:"template-variable",variants:[{begin:"{{",end:"}}"},{begin:"%{",end:"}"}]}]};return{case_insensitive:!0,aliases:["yml","YAML","yaml"],contains:[t,{className:"meta",begin:"^---s*$",relevance:10},{className:"string",begin:"[\\|>] *$",returnEnd:!0,contains:a.contains,end:t.variants[0].begin},{begin:"<%[%=-]?",end:"[%-]?%>",subLanguage:"ruby",excludeBegin:!0,excludeEnd:!0,relevance:0},{className:"type",begin:"!!"+e.UNDERSCORE_IDENT_RE},{className:"meta",begin:"&"+e.UNDERSCORE_IDENT_RE+"$"},{className:"meta",begin:"\\*"+e.UNDERSCORE_IDENT_RE+"$"},{className:"bullet",begin:"^ *-",relevance:0},e.HASH_COMMENT_MODE,{beginKeywords:"true false yes no null",keywords:{literal:"true false yes no null"}},e.C_NUMBER_MODE,a]}})})(n)}()},81:function(e,n,t){var a,r,i;r=this,i=window.srcDoc,void 0===(a=function(e){!function(e,n){var t,a,r,i=!!("srcdoc"in document.createElement("iframe")),s="Polyfill may not function in the presence of the `sandbox` attribute. Consider using the `force` option.",o=/\ballow-same-origin\b/,l=function(e,n){var t=e.getAttribute("sandbox");"string"!=typeof t||o.test(t)||(n&&n.force?e.removeAttribute("sandbox"):n&&!1===n.force||(r(s),e.setAttribute("data-srcdoc-polyfill",s)))},c={compliant:function(e,n,t){n&&(l(e,t),e.setAttribute("srcdoc",n))},legacy:function(e,n,t){var a;e&&e.getAttribute&&(n?e.setAttribute("srcdoc",n):n=e.getAttribute("srcdoc"),n&&(l(e,t),a="javascript: window.frameElement.getAttribute('srcdoc');",e.contentWindow&&(e.contentWindow.location=a),e.setAttribute("src",a)))}},d=e;if(r=window.console&&window.console.error?function(e){window.console.error("[srcdoc-polyfill] "+e)}:function(){},d.set=c.compliant,d.noConflict=function(){return window.srcDoc=n,d},!i)for(d.set=c.legacy,a=document.getElementsByTagName("iframe"),t=a.length;t--;)d.set(a[t])}(e,i),r.srcDoc=e}.apply(n,[n]))||(e.exports=a)},82:function(e,n){ | ||
/*! matchMedia() polyfill addListener/removeListener extension. Author & copyright (c) 2012: Scott Jehl. Dual MIT/BSD license */ | ||
!function(){if(window.matchMedia&&window.matchMedia("all").addListener)return!1;var e=window.matchMedia,n=e("only all").matches,t=!1,a=0,r=[],i=function(n){clearTimeout(a),a=setTimeout(function(){for(var n=0,t=r.length;n<t;n++){var a=r[n].mql,i=r[n].listeners||[],s=e(a.media).matches;if(s!==a.matches){a.matches=s;for(var o=0,l=i.length;o<l;o++)i[o].call(window,a)}}},30)};window.matchMedia=function(a){var s=e(a),o=[],l=0;return s.addListener=function(e){n&&(t||(t=!0,window.addEventListener("resize",i,!0)),0===l&&(l=r.push({mql:s,listeners:o})),o.push(e))},s.removeListener=function(e){for(var n=0,t=o.length;n<t;n++)o[n]===e&&o.splice(n,1)},s}}()},83:function(e,n){ | ||
/*! matchMedia() polyfill - Test a CSS media type/query in JS. Authors & copyright (c) 2012: Scott Jehl, Paul Irish, Nicholas Zakas, David Knight. Dual MIT/BSD license */ | ||
window.matchMedia||(window.matchMedia=function(){"use strict";var e=window.styleMedia||window.media;if(!e){var n,t=document.createElement("style"),a=document.getElementsByTagName("script")[0];t.type="text/css",t.id="matchmediajs-test",a.parentNode.insertBefore(t,a),n="getComputedStyle"in window&&window.getComputedStyle(t,null)||t.currentStyle,e={matchMedium:function(e){var a="@media "+e+"{ #matchmediajs-test { width: 1px; } }";return t.styleSheet?t.styleSheet.cssText=a:t.textContent=a,"1px"===n.width}}}return function(n){return{matches:e.matchMedium(n||"all"),media:n||"all"}}}())},84:function(e,n,t){"use strict";t.r(n),function(e){t(83),t(82),t(81);var n=t(49),a=t.n(n),r=t(18);e(function(){window.$=e,a.a.initHighlighting(),r.c(),r.a(),r.b()})}.call(this,t(16))}},[[84,0,1]]]); | ||
(window.webpackJsonp=window.webpackJsonp||[]).push([[2],{"+3Jt":function(e,n,t){"use strict";t.r(n),function(e){t("AzGU"),t("dYcP"),t("5KAr");var n=t("YEG7"),a=t.n(n),i=t("t3mS");e(function(){window.$=e,a.a.initHighlighting(),i.c(),i.a(),i.b()})}.call(this,t("26+0"))},"5KAr":function(e,n,t){var a,i,r;i=this,r=window.srcDoc,void 0===(a=function(e){!function(e,n){var t,a,i,r=!!("srcdoc"in document.createElement("iframe")),s="Polyfill may not function in the presence of the `sandbox` attribute. Consider using the `force` option.",o=/\ballow-same-origin\b/,l=function(e,n){var t=e.getAttribute("sandbox");"string"!=typeof t||o.test(t)||(n&&n.force?e.removeAttribute("sandbox"):n&&!1===n.force||(i(s),e.setAttribute("data-srcdoc-polyfill",s)))},c={compliant:function(e,n,t){n&&(l(e,t),e.setAttribute("srcdoc",n))},legacy:function(e,n,t){var a;e&&e.getAttribute&&(n?e.setAttribute("srcdoc",n):n=e.getAttribute("srcdoc"),n&&(l(e,t),a="javascript: window.frameElement.getAttribute('srcdoc');",e.contentWindow&&(e.contentWindow.location=a),e.setAttribute("src",a)))}},d=e;if(i=window.console&&window.console.error?function(e){window.console.error("[srcdoc-polyfill] "+e)}:function(){},d.set=c.compliant,d.noConflict=function(){return window.srcDoc=n,d},!r)for(d.set=c.legacy,a=document.getElementsByTagName("iframe"),t=a.length;t--;)d.set(a[t])}(e,r),i.srcDoc=e}.apply(n,[n]))||(e.exports=a)},AzGU:function(e,n){ | ||
/*! matchMedia() polyfill - Test a CSS media type/query in JS. Authors & copyright (c) 2012: Scott Jehl, Paul Irish, Nicholas Zakas, David Knight. MIT license */ | ||
window.matchMedia||(window.matchMedia=function(){"use strict";var e=window.styleMedia||window.media;if(!e){var n,t=document.createElement("style"),a=document.getElementsByTagName("script")[0];t.type="text/css",t.id="matchmediajs-test",a?a.parentNode.insertBefore(t,a):document.head.appendChild(t),n="getComputedStyle"in window&&window.getComputedStyle(t,null)||t.currentStyle,e={matchMedium:function(e){var a="@media "+e+"{ #matchmediajs-test { width: 1px; } }";return t.styleSheet?t.styleSheet.cssText=a:t.textContent=a,"1px"===n.width}}}return function(n){return{matches:e.matchMedium(n||"all"),media:n||"all"}}}())},YEG7:function(e,n,t){ | ||
/*! highlight.js v9.13.1 | BSD3 License | git.io/hljslicense */ | ||
/*! generated with command: | ||
node tools/build.js -n -t browser bash css xml django javascript json markdown scss shell ruby yaml | ||
*/ | ||
!function(e){"object"==typeof window&&window||"object"==typeof self&&self;(function(e){var n=[],t=Object.keys,a={},i={},r=/^(no-?highlight|plain|text)$/i,s=/\blang(?:uage)?-([\w-]+)\b/i,o=/((^(<[^>]+>|\t|)+|(?:\n)))/gm,l="</span>",c={classPrefix:"hljs-",tabReplace:null,useBR:!1,languages:void 0};function d(e){return e.replace(/&/g,"&").replace(/</g,"<").replace(/>/g,">")}function g(e){return e.nodeName.toLowerCase()}function u(e,n){var t=e&&e.exec(n);return t&&0===t.index}function m(e){return r.test(e)}function b(e){var n,t={},a=Array.prototype.slice.call(arguments,1);for(n in e)t[n]=e[n];return a.forEach(function(e){for(n in e)t[n]=e[n]}),t}function f(e){var n=[];return function e(t,a){for(var i=t.firstChild;i;i=i.nextSibling)3===i.nodeType?a+=i.nodeValue.length:1===i.nodeType&&(n.push({event:"start",offset:a,node:i}),a=e(i,a),g(i).match(/br|hr|img|input/)||n.push({event:"stop",offset:a,node:i}));return a}(e,0),n}function p(e){function n(e){return e&&e.source||e}function a(t,a){return new RegExp(n(t),"m"+(e.case_insensitive?"i":"")+(a?"g":""))}!function i(r,s){if(r.compiled)return;r.compiled=!0;r.keywords=r.keywords||r.beginKeywords;if(r.keywords){var o={},l=function(n,t){e.case_insensitive&&(t=t.toLowerCase()),t.split(" ").forEach(function(e){var t=e.split("|");o[t[0]]=[n,t[1]?Number(t[1]):1]})};"string"==typeof r.keywords?l("keyword",r.keywords):t(r.keywords).forEach(function(e){l(e,r.keywords[e])}),r.keywords=o}r.lexemesRe=a(r.lexemes||/\w+/,!0);s&&(r.beginKeywords&&(r.begin="\\b("+r.beginKeywords.split(" ").join("|")+")\\b"),r.begin||(r.begin=/\B|\b/),r.beginRe=a(r.begin),r.endSameAsBegin&&(r.end=r.begin),r.end||r.endsWithParent||(r.end=/\B|\b/),r.end&&(r.endRe=a(r.end)),r.terminator_end=n(r.end)||"",r.endsWithParent&&s.terminator_end&&(r.terminator_end+=(r.end?"|":"")+s.terminator_end));r.illegal&&(r.illegalRe=a(r.illegal));null==r.relevance&&(r.relevance=1);r.contains||(r.contains=[]);r.contains=Array.prototype.concat.apply([],r.contains.map(function(e){return function(e){e.variants&&!e.cached_variants&&(e.cached_variants=e.variants.map(function(n){return b(e,{variants:null},n)}));return e.cached_variants||e.endsWithParent&&[b(e)]||[e]}("self"===e?r:e)}));r.contains.forEach(function(e){i(e,r)});r.starts&&i(r.starts,s);var c=r.contains.map(function(e){return e.beginKeywords?"\\.?("+e.begin+")\\.?":e.begin}).concat([r.terminator_end,r.illegal]).map(n).filter(Boolean);r.terminators=c.length?a(c.join("|"),!0):{exec:function(){return null}}}(e)}function h(e,n,t,i){function r(e,n){var t=b.case_insensitive?n[0].toLowerCase():n[0];return e.keywords.hasOwnProperty(t)&&e.keywords[t]}function s(e,n,t,a){var i=a?"":c.classPrefix,r='<span class="'+i,s=t?"":l;return(r+=e+'">')+n+s}function o(){v+=null!=w.subLanguage?function(){var e="string"==typeof w.subLanguage;if(e&&!a[w.subLanguage])return d(y);var n=e?h(w.subLanguage,y,!0,_[w.subLanguage]):E(y,w.subLanguage.length?w.subLanguage:void 0);w.relevance>0&&(x+=n.relevance);e&&(_[w.subLanguage]=n.top);return s(n.language,n.value,!1,!0)}():function(){var e,n,t,a;if(!w.keywords)return d(y);a="",n=0,w.lexemesRe.lastIndex=0,t=w.lexemesRe.exec(y);for(;t;)a+=d(y.substring(n,t.index)),(e=r(w,t))?(x+=e[1],a+=s(e[0],d(t[0]))):a+=d(t[0]),n=w.lexemesRe.lastIndex,t=w.lexemesRe.exec(y);return a+d(y.substr(n))}(),y=""}function g(e){v+=e.className?s(e.className,"",!0):"",w=Object.create(e,{parent:{value:w}})}function m(e,n){if(y+=e,null==n)return o(),0;var a=function(e,n){var t,a;for(t=0,a=n.contains.length;t<a;t++)if(u(n.contains[t].beginRe,e))return n.contains[t].endSameAsBegin&&(n.contains[t].endRe=(i=n.contains[t].beginRe.exec(e)[0],new RegExp(i.replace(/[-\/\\^$*+?.()|[\]{}]/g,"\\$&"),"m"))),n.contains[t];var i}(n,w);if(a)return a.skip?y+=n:(a.excludeBegin&&(y+=n),o(),a.returnBegin||a.excludeBegin||(y=n)),g(a),a.returnBegin?0:n.length;var i=function e(n,t){if(u(n.endRe,t)){for(;n.endsParent&&n.parent;)n=n.parent;return n}if(n.endsWithParent)return e(n.parent,t)}(w,n);if(i){var r=w;r.skip?y+=n:(r.returnEnd||r.excludeEnd||(y+=n),o(),r.excludeEnd&&(y=n));do{w.className&&(v+=l),w.skip||w.subLanguage||(x+=w.relevance),w=w.parent}while(w!==i.parent);return i.starts&&(i.endSameAsBegin&&(i.starts.endRe=i.endRe),g(i.starts)),r.returnEnd?0:n.length}if(function(e,n){return!t&&u(n.illegalRe,e)}(n,w))throw new Error('Illegal lexeme "'+n+'" for mode "'+(w.className||"<unnamed>")+'"');return y+=n,n.length||1}var b=N(e);if(!b)throw new Error('Unknown language: "'+e+'"');p(b);var f,w=i||b,_={},v="";for(f=w;f!==b;f=f.parent)f.className&&(v=s(f.className,"",!0)+v);var y="",x=0;try{for(var M,O,S=0;w.terminators.lastIndex=S,M=w.terminators.exec(n);)O=m(n.substring(S,M.index),M[0]),S=M.index+O;for(m(n.substr(S)),f=w;f.parent;f=f.parent)f.className&&(v+=l);return{relevance:x,value:v,language:e,top:w}}catch(e){if(e.message&&-1!==e.message.indexOf("Illegal"))return{relevance:0,value:d(n)};throw e}}function E(e,n){n=n||c.languages||t(a);var i={relevance:0,value:d(e)},r=i;return n.filter(N).filter(y).forEach(function(n){var t=h(n,e,!1);t.language=n,t.relevance>r.relevance&&(r=t),t.relevance>i.relevance&&(r=i,i=t)}),r.language&&(i.second_best=r),i}function w(e){return c.tabReplace||c.useBR?e.replace(o,function(e,n){return c.useBR&&"\n"===e?"<br>":c.tabReplace?n.replace(/\t/g,c.tabReplace):""}):e}function _(e){var t,a,r,o,l,u=function(e){var n,t,a,i,r=e.className+" ";if(r+=e.parentNode?e.parentNode.className:"",t=s.exec(r))return N(t[1])?t[1]:"no-highlight";for(r=r.split(/\s+/),n=0,a=r.length;n<a;n++)if(m(i=r[n])||N(i))return i}(e);m(u)||(c.useBR?(t=document.createElementNS("http://www.w3.org/1999/xhtml","div")).innerHTML=e.innerHTML.replace(/\n/g,"").replace(/<br[ \/]*>/g,"\n"):t=e,l=t.textContent,r=u?h(u,l,!0):E(l),(a=f(t)).length&&((o=document.createElementNS("http://www.w3.org/1999/xhtml","div")).innerHTML=r.value,r.value=function(e,t,a){var i=0,r="",s=[];function o(){return e.length&&t.length?e[0].offset!==t[0].offset?e[0].offset<t[0].offset?e:t:"start"===t[0].event?e:t:e.length?e:t}function l(e){r+="<"+g(e)+n.map.call(e.attributes,function(e){return" "+e.nodeName+'="'+d(e.value).replace('"',""")+'"'}).join("")+">"}function c(e){r+="</"+g(e)+">"}function u(e){("start"===e.event?l:c)(e.node)}for(;e.length||t.length;){var m=o();if(r+=d(a.substring(i,m[0].offset)),i=m[0].offset,m===e){s.reverse().forEach(c);do{u(m.splice(0,1)[0]),m=o()}while(m===e&&m.length&&m[0].offset===i);s.reverse().forEach(l)}else"start"===m[0].event?s.push(m[0].node):s.pop(),u(m.splice(0,1)[0])}return r+d(a.substr(i))}(a,f(o),l)),r.value=w(r.value),e.innerHTML=r.value,e.className=function(e,n,t){var a=n?i[n]:t,r=[e.trim()];e.match(/\bhljs\b/)||r.push("hljs");-1===e.indexOf(a)&&r.push(a);return r.join(" ").trim()}(e.className,u,r.language),e.result={language:r.language,re:r.relevance},r.second_best&&(e.second_best={language:r.second_best.language,re:r.second_best.relevance}))}function v(){if(!v.called){v.called=!0;var e=document.querySelectorAll("pre code");n.forEach.call(e,_)}}function N(e){return e=(e||"").toLowerCase(),a[e]||a[i[e]]}function y(e){var n=N(e);return n&&!n.disableAutodetect}e.highlight=h,e.highlightAuto=E,e.fixMarkup=w,e.highlightBlock=_,e.configure=function(e){c=b(c,e)},e.initHighlighting=v,e.initHighlightingOnLoad=function(){addEventListener("DOMContentLoaded",v,!1),addEventListener("load",v,!1)},e.registerLanguage=function(n,t){var r=a[n]=t(e);r.aliases&&r.aliases.forEach(function(e){i[e]=n})},e.listLanguages=function(){return t(a)},e.getLanguage=N,e.autoDetection=y,e.inherit=b,e.IDENT_RE="[a-zA-Z]\\w*",e.UNDERSCORE_IDENT_RE="[a-zA-Z_]\\w*",e.NUMBER_RE="\\b\\d+(\\.\\d+)?",e.C_NUMBER_RE="(-?)(\\b0[xX][a-fA-F0-9]+|(\\b\\d+(\\.\\d*)?|\\.\\d+)([eE][-+]?\\d+)?)",e.BINARY_NUMBER_RE="\\b(0b[01]+)",e.RE_STARTERS_RE="!|!=|!==|%|%=|&|&&|&=|\\*|\\*=|\\+|\\+=|,|-|-=|/=|/|:|;|<<|<<=|<=|<|===|==|=|>>>=|>>=|>=|>>>|>>|>|\\?|\\[|\\{|\\(|\\^|\\^=|\\||\\|=|\\|\\||~",e.BACKSLASH_ESCAPE={begin:"\\\\[\\s\\S]",relevance:0},e.APOS_STRING_MODE={className:"string",begin:"'",end:"'",illegal:"\\n",contains:[e.BACKSLASH_ESCAPE]},e.QUOTE_STRING_MODE={className:"string",begin:'"',end:'"',illegal:"\\n",contains:[e.BACKSLASH_ESCAPE]},e.PHRASAL_WORDS_MODE={begin:/\b(a|an|the|are|I'm|isn't|don't|doesn't|won't|but|just|should|pretty|simply|enough|gonna|going|wtf|so|such|will|you|your|they|like|more)\b/},e.COMMENT=function(n,t,a){var i=e.inherit({className:"comment",begin:n,end:t,contains:[]},a||{});return i.contains.push(e.PHRASAL_WORDS_MODE),i.contains.push({className:"doctag",begin:"(?:TODO|FIXME|NOTE|BUG|XXX):",relevance:0}),i},e.C_LINE_COMMENT_MODE=e.COMMENT("//","$"),e.C_BLOCK_COMMENT_MODE=e.COMMENT("/\\*","\\*/"),e.HASH_COMMENT_MODE=e.COMMENT("#","$"),e.NUMBER_MODE={className:"number",begin:e.NUMBER_RE,relevance:0},e.C_NUMBER_MODE={className:"number",begin:e.C_NUMBER_RE,relevance:0},e.BINARY_NUMBER_MODE={className:"number",begin:e.BINARY_NUMBER_RE,relevance:0},e.CSS_NUMBER_MODE={className:"number",begin:e.NUMBER_RE+"(%|em|ex|ch|rem|vw|vh|vmin|vmax|cm|mm|in|pt|pc|px|deg|grad|rad|turn|s|ms|Hz|kHz|dpi|dpcm|dppx)?",relevance:0},e.REGEXP_MODE={className:"regexp",begin:/\//,end:/\/[gimuy]*/,illegal:/\n/,contains:[e.BACKSLASH_ESCAPE,{begin:/\[/,end:/\]/,relevance:0,contains:[e.BACKSLASH_ESCAPE]}]},e.TITLE_MODE={className:"title",begin:e.IDENT_RE,relevance:0},e.UNDERSCORE_TITLE_MODE={className:"title",begin:e.UNDERSCORE_IDENT_RE,relevance:0},e.METHOD_GUARD={begin:"\\.\\s*"+e.UNDERSCORE_IDENT_RE,relevance:0},e.registerLanguage("bash",function(e){var n={className:"variable",variants:[{begin:/\$[\w\d#@][\w\d_]*/},{begin:/\$\{(.*?)}/}]},t={className:"string",begin:/"/,end:/"/,contains:[e.BACKSLASH_ESCAPE,n,{className:"variable",begin:/\$\(/,end:/\)/,contains:[e.BACKSLASH_ESCAPE]}]};return{aliases:["sh","zsh"],lexemes:/\b-?[a-z\._]+\b/,keywords:{keyword:"if then else elif fi for while in do done case esac function",literal:"true false",built_in:"break cd continue eval exec exit export getopts hash pwd readonly return shift test times trap umask unset alias bind builtin caller command declare echo enable help let local logout mapfile printf read readarray source type typeset ulimit unalias set shopt autoload bg bindkey bye cap chdir clone comparguments compcall compctl compdescribe compfiles compgroups compquote comptags comptry compvalues dirs disable disown echotc echoti emulate fc fg float functions getcap getln history integer jobs kill limit log noglob popd print pushd pushln rehash sched setcap setopt stat suspend ttyctl unfunction unhash unlimit unsetopt vared wait whence where which zcompile zformat zftp zle zmodload zparseopts zprof zpty zregexparse zsocket zstyle ztcp",_:"-ne -eq -lt -gt -f -d -e -s -l -a"},contains:[{className:"meta",begin:/^#![^\n]+sh\s*$/,relevance:10},{className:"function",begin:/\w[\w\d_]*\s*\(\s*\)\s*\{/,returnBegin:!0,contains:[e.inherit(e.TITLE_MODE,{begin:/\w[\w\d_]*/})],relevance:0},e.HASH_COMMENT_MODE,t,{className:"string",begin:/'/,end:/'/},n]}}),e.registerLanguage("css",function(e){var n={begin:/[A-Z\_\.\-]+\s*:/,returnBegin:!0,end:";",endsWithParent:!0,contains:[{className:"attribute",begin:/\S/,end:":",excludeEnd:!0,starts:{endsWithParent:!0,excludeEnd:!0,contains:[{begin:/[\w-]+\(/,returnBegin:!0,contains:[{className:"built_in",begin:/[\w-]+/},{begin:/\(/,end:/\)/,contains:[e.APOS_STRING_MODE,e.QUOTE_STRING_MODE]}]},e.CSS_NUMBER_MODE,e.QUOTE_STRING_MODE,e.APOS_STRING_MODE,e.C_BLOCK_COMMENT_MODE,{className:"number",begin:"#[0-9A-Fa-f]+"},{className:"meta",begin:"!important"}]}}]};return{case_insensitive:!0,illegal:/[=\/|'\$]/,contains:[e.C_BLOCK_COMMENT_MODE,{className:"selector-id",begin:/#[A-Za-z0-9_-]+/},{className:"selector-class",begin:/\.[A-Za-z0-9_-]+/},{className:"selector-attr",begin:/\[/,end:/\]/,illegal:"$"},{className:"selector-pseudo",begin:/:(:)?[a-zA-Z0-9\_\-\+\(\)"'.]+/},{begin:"@(font-face|page)",lexemes:"[a-z-]+",keywords:"font-face page"},{begin:"@",end:"[{;]",illegal:/:/,contains:[{className:"keyword",begin:/\w+/},{begin:/\s/,endsWithParent:!0,excludeEnd:!0,relevance:0,contains:[e.APOS_STRING_MODE,e.QUOTE_STRING_MODE,e.CSS_NUMBER_MODE]}]},{className:"selector-tag",begin:"[a-zA-Z-][a-zA-Z0-9_-]*",relevance:0},{begin:"{",end:"}",illegal:/\S/,contains:[e.C_BLOCK_COMMENT_MODE,n]}]}}),e.registerLanguage("xml",function(e){var n={endsWithParent:!0,illegal:/</,relevance:0,contains:[{className:"attr",begin:"[A-Za-z0-9\\._:-]+",relevance:0},{begin:/=\s*/,relevance:0,contains:[{className:"string",endsParent:!0,variants:[{begin:/"/,end:/"/},{begin:/'/,end:/'/},{begin:/[^\s"'=<>`]+/}]}]}]};return{aliases:["html","xhtml","rss","atom","xjb","xsd","xsl","plist"],case_insensitive:!0,contains:[{className:"meta",begin:"<!DOCTYPE",end:">",relevance:10,contains:[{begin:"\\[",end:"\\]"}]},e.COMMENT("\x3c!--","--\x3e",{relevance:10}),{begin:"<\\!\\[CDATA\\[",end:"\\]\\]>",relevance:10},{className:"meta",begin:/<\?xml/,end:/\?>/,relevance:10},{begin:/<\?(php)?/,end:/\?>/,subLanguage:"php",contains:[{begin:"/\\*",end:"\\*/",skip:!0},{begin:'b"',end:'"',skip:!0},{begin:"b'",end:"'",skip:!0},e.inherit(e.APOS_STRING_MODE,{illegal:null,className:null,contains:null,skip:!0}),e.inherit(e.QUOTE_STRING_MODE,{illegal:null,className:null,contains:null,skip:!0})]},{className:"tag",begin:"<style(?=\\s|>|$)",end:">",keywords:{name:"style"},contains:[n],starts:{end:"</style>",returnEnd:!0,subLanguage:["css","xml"]}},{className:"tag",begin:"<script(?=\\s|>|$)",end:">",keywords:{name:"script"},contains:[n],starts:{end:"<\/script>",returnEnd:!0,subLanguage:["actionscript","javascript","handlebars","xml"]}},{className:"tag",begin:"</?",end:"/?>",contains:[{className:"name",begin:/[^\/><\s]+/,relevance:0},n]}]}}),e.registerLanguage("django",function(e){var n={begin:/\|[A-Za-z]+:?/,keywords:{name:"truncatewords removetags linebreaksbr yesno get_digit timesince random striptags filesizeformat escape linebreaks length_is ljust rjust cut urlize fix_ampersands title floatformat capfirst pprint divisibleby add make_list unordered_list urlencode timeuntil urlizetrunc wordcount stringformat linenumbers slice date dictsort dictsortreversed default_if_none pluralize lower join center default truncatewords_html upper length phone2numeric wordwrap time addslashes slugify first escapejs force_escape iriencode last safe safeseq truncatechars localize unlocalize localtime utc timezone"},contains:[e.QUOTE_STRING_MODE,e.APOS_STRING_MODE]};return{aliases:["jinja"],case_insensitive:!0,subLanguage:"xml",contains:[e.COMMENT(/\{%\s*comment\s*%}/,/\{%\s*endcomment\s*%}/),e.COMMENT(/\{#/,/#}/),{className:"template-tag",begin:/\{%/,end:/%}/,contains:[{className:"name",begin:/\w+/,keywords:{name:"comment endcomment load templatetag ifchanged endifchanged if endif firstof for endfor ifnotequal endifnotequal widthratio extends include spaceless endspaceless regroup ifequal endifequal ssi now with cycle url filter endfilter debug block endblock else autoescape endautoescape csrf_token empty elif endwith static trans blocktrans endblocktrans get_static_prefix get_media_prefix plural get_current_language language get_available_languages get_current_language_bidi get_language_info get_language_info_list localize endlocalize localtime endlocaltime timezone endtimezone get_current_timezone verbatim"},starts:{endsWithParent:!0,keywords:"in by as",contains:[n],relevance:0}}]},{className:"template-variable",begin:/\{\{/,end:/}}/,contains:[n]}]}}),e.registerLanguage("javascript",function(e){var n="[A-Za-z$_][0-9A-Za-z$_]*",t={keyword:"in of if for while finally var new function do return void else break catch instanceof with throw case default try this switch continue typeof delete let yield const export super debugger as async await static import from as",literal:"true false null undefined NaN Infinity",built_in:"eval isFinite isNaN parseFloat parseInt decodeURI decodeURIComponent encodeURI encodeURIComponent escape unescape Object Function Boolean Error EvalError InternalError RangeError ReferenceError StopIteration SyntaxError TypeError URIError Number Math Date String RegExp Array Float32Array Float64Array Int16Array Int32Array Int8Array Uint16Array Uint32Array Uint8Array Uint8ClampedArray ArrayBuffer DataView JSON Intl arguments require module console window document Symbol Set Map WeakSet WeakMap Proxy Reflect Promise"},a={className:"number",variants:[{begin:"\\b(0[bB][01]+)"},{begin:"\\b(0[oO][0-7]+)"},{begin:e.C_NUMBER_RE}],relevance:0},i={className:"subst",begin:"\\$\\{",end:"\\}",keywords:t,contains:[]},r={className:"string",begin:"`",end:"`",contains:[e.BACKSLASH_ESCAPE,i]};i.contains=[e.APOS_STRING_MODE,e.QUOTE_STRING_MODE,r,a,e.REGEXP_MODE];var s=i.contains.concat([e.C_BLOCK_COMMENT_MODE,e.C_LINE_COMMENT_MODE]);return{aliases:["js","jsx"],keywords:t,contains:[{className:"meta",relevance:10,begin:/^\s*['"]use (strict|asm)['"]/},{className:"meta",begin:/^#!/,end:/$/},e.APOS_STRING_MODE,e.QUOTE_STRING_MODE,r,e.C_LINE_COMMENT_MODE,e.C_BLOCK_COMMENT_MODE,a,{begin:/[{,]\s*/,relevance:0,contains:[{begin:n+"\\s*:",returnBegin:!0,relevance:0,contains:[{className:"attr",begin:n,relevance:0}]}]},{begin:"("+e.RE_STARTERS_RE+"|\\b(case|return|throw)\\b)\\s*",keywords:"return throw case",contains:[e.C_LINE_COMMENT_MODE,e.C_BLOCK_COMMENT_MODE,e.REGEXP_MODE,{className:"function",begin:"(\\(.*?\\)|"+n+")\\s*=>",returnBegin:!0,end:"\\s*=>",contains:[{className:"params",variants:[{begin:n},{begin:/\(\s*\)/},{begin:/\(/,end:/\)/,excludeBegin:!0,excludeEnd:!0,keywords:t,contains:s}]}]},{begin:/</,end:/(\/\w+|\w+\/)>/,subLanguage:"xml",contains:[{begin:/<\w+\s*\/>/,skip:!0},{begin:/<\w+/,end:/(\/\w+|\w+\/)>/,skip:!0,contains:[{begin:/<\w+\s*\/>/,skip:!0},"self"]}]}],relevance:0},{className:"function",beginKeywords:"function",end:/\{/,excludeEnd:!0,contains:[e.inherit(e.TITLE_MODE,{begin:n}),{className:"params",begin:/\(/,end:/\)/,excludeBegin:!0,excludeEnd:!0,contains:s}],illegal:/\[|%/},{begin:/\$[(.]/},e.METHOD_GUARD,{className:"class",beginKeywords:"class",end:/[{;=]/,excludeEnd:!0,illegal:/[:"\[\]]/,contains:[{beginKeywords:"extends"},e.UNDERSCORE_TITLE_MODE]},{beginKeywords:"constructor",end:/\{/,excludeEnd:!0}],illegal:/#(?!!)/}}),e.registerLanguage("json",function(e){var n={literal:"true false null"},t=[e.QUOTE_STRING_MODE,e.C_NUMBER_MODE],a={end:",",endsWithParent:!0,excludeEnd:!0,contains:t,keywords:n},i={begin:"{",end:"}",contains:[{className:"attr",begin:/"/,end:/"/,contains:[e.BACKSLASH_ESCAPE],illegal:"\\n"},e.inherit(a,{begin:/:/})],illegal:"\\S"},r={begin:"\\[",end:"\\]",contains:[e.inherit(a)],illegal:"\\S"};return t.splice(t.length,0,i,r),{contains:t,keywords:n,illegal:"\\S"}}),e.registerLanguage("markdown",function(e){return{aliases:["md","mkdown","mkd"],contains:[{className:"section",variants:[{begin:"^#{1,6}",end:"$"},{begin:"^.+?\\n[=-]{2,}$"}]},{begin:"<",end:">",subLanguage:"xml",relevance:0},{className:"bullet",begin:"^([*+-]|(\\d+\\.))\\s+"},{className:"strong",begin:"[*_]{2}.+?[*_]{2}"},{className:"emphasis",variants:[{begin:"\\*.+?\\*"},{begin:"_.+?_",relevance:0}]},{className:"quote",begin:"^>\\s+",end:"$"},{className:"code",variants:[{begin:"^```w*s*$",end:"^```s*$"},{begin:"`.+?`"},{begin:"^( {4}|\t)",end:"$",relevance:0}]},{begin:"^[-\\*]{3,}",end:"$"},{begin:"\\[.+?\\][\\(\\[].*?[\\)\\]]",returnBegin:!0,contains:[{className:"string",begin:"\\[",end:"\\]",excludeBegin:!0,returnEnd:!0,relevance:0},{className:"link",begin:"\\]\\(",end:"\\)",excludeBegin:!0,excludeEnd:!0},{className:"symbol",begin:"\\]\\[",end:"\\]",excludeBegin:!0,excludeEnd:!0}],relevance:10},{begin:/^\[[^\n]+\]:/,returnBegin:!0,contains:[{className:"symbol",begin:/\[/,end:/\]/,excludeBegin:!0,excludeEnd:!0},{className:"link",begin:/:\s*/,end:/$/,excludeBegin:!0}]}]}}),e.registerLanguage("ruby",function(e){var n="[a-zA-Z_]\\w*[!?=]?|[-+~]\\@|<<|>>|=~|===?|<=>|[<>]=?|\\*\\*|[-/+%^&*~`|]|\\[\\]=?",t={keyword:"and then defined module in return redo if BEGIN retry end for self when next until do begin unless END rescue else break undef not super class case require yield alias while ensure elsif or include attr_reader attr_writer attr_accessor",literal:"true false nil"},a={className:"doctag",begin:"@[A-Za-z]+"},i={begin:"#<",end:">"},r=[e.COMMENT("#","$",{contains:[a]}),e.COMMENT("^\\=begin","^\\=end",{contains:[a],relevance:10}),e.COMMENT("^__END__","\\n$")],s={className:"subst",begin:"#\\{",end:"}",keywords:t},o={className:"string",contains:[e.BACKSLASH_ESCAPE,s],variants:[{begin:/'/,end:/'/},{begin:/"/,end:/"/},{begin:/`/,end:/`/},{begin:"%[qQwWx]?\\(",end:"\\)"},{begin:"%[qQwWx]?\\[",end:"\\]"},{begin:"%[qQwWx]?{",end:"}"},{begin:"%[qQwWx]?<",end:">"},{begin:"%[qQwWx]?/",end:"/"},{begin:"%[qQwWx]?%",end:"%"},{begin:"%[qQwWx]?-",end:"-"},{begin:"%[qQwWx]?\\|",end:"\\|"},{begin:/\B\?(\\\d{1,3}|\\x[A-Fa-f0-9]{1,2}|\\u[A-Fa-f0-9]{4}|\\?\S)\b/},{begin:/<<(-?)\w+$/,end:/^\s*\w+$/}]},l={className:"params",begin:"\\(",end:"\\)",endsParent:!0,keywords:t},c=[o,i,{className:"class",beginKeywords:"class module",end:"$|;",illegal:/=/,contains:[e.inherit(e.TITLE_MODE,{begin:"[A-Za-z_]\\w*(::\\w+)*(\\?|\\!)?"}),{begin:"<\\s*",contains:[{begin:"("+e.IDENT_RE+"::)?"+e.IDENT_RE}]}].concat(r)},{className:"function",beginKeywords:"def",end:"$|;",contains:[e.inherit(e.TITLE_MODE,{begin:n}),l].concat(r)},{begin:e.IDENT_RE+"::"},{className:"symbol",begin:e.UNDERSCORE_IDENT_RE+"(\\!|\\?)?:",relevance:0},{className:"symbol",begin:":(?!\\s)",contains:[o,{begin:n}],relevance:0},{className:"number",begin:"(\\b0[0-7_]+)|(\\b0x[0-9a-fA-F_]+)|(\\b[1-9][0-9_]*(\\.[0-9_]+)?)|[0_]\\b",relevance:0},{begin:"(\\$\\W)|((\\$|\\@\\@?)(\\w+))"},{className:"params",begin:/\|/,end:/\|/,keywords:t},{begin:"("+e.RE_STARTERS_RE+"|unless)\\s*",keywords:"unless",contains:[i,{className:"regexp",contains:[e.BACKSLASH_ESCAPE,s],illegal:/\n/,variants:[{begin:"/",end:"/[a-z]*"},{begin:"%r{",end:"}[a-z]*"},{begin:"%r\\(",end:"\\)[a-z]*"},{begin:"%r!",end:"![a-z]*"},{begin:"%r\\[",end:"\\][a-z]*"}]}].concat(r),relevance:0}].concat(r);s.contains=c,l.contains=c;var d=[{begin:/^\s*=>/,starts:{end:"$",contains:c}},{className:"meta",begin:"^([>?]>|[\\w#]+\\(\\w+\\):\\d+:\\d+>|(\\w+-)?\\d+\\.\\d+\\.\\d(p\\d+)?[^>]+>)",starts:{end:"$",contains:c}}];return{aliases:["rb","gemspec","podspec","thor","irb"],keywords:t,illegal:/\/\*/,contains:r.concat(d).concat(c)}}),e.registerLanguage("scss",function(e){var n={className:"variable",begin:"(\\$[a-zA-Z-][a-zA-Z0-9_-]*)\\b"},t={className:"number",begin:"#[0-9A-Fa-f]+"};return e.CSS_NUMBER_MODE,e.QUOTE_STRING_MODE,e.APOS_STRING_MODE,e.C_BLOCK_COMMENT_MODE,{case_insensitive:!0,illegal:"[=/|']",contains:[e.C_LINE_COMMENT_MODE,e.C_BLOCK_COMMENT_MODE,{className:"selector-id",begin:"\\#[A-Za-z0-9_-]+",relevance:0},{className:"selector-class",begin:"\\.[A-Za-z0-9_-]+",relevance:0},{className:"selector-attr",begin:"\\[",end:"\\]",illegal:"$"},{className:"selector-tag",begin:"\\b(a|abbr|acronym|address|area|article|aside|audio|b|base|big|blockquote|body|br|button|canvas|caption|cite|code|col|colgroup|command|datalist|dd|del|details|dfn|div|dl|dt|em|embed|fieldset|figcaption|figure|footer|form|frame|frameset|(h[1-6])|head|header|hgroup|hr|html|i|iframe|img|input|ins|kbd|keygen|label|legend|li|link|map|mark|meta|meter|nav|noframes|noscript|object|ol|optgroup|option|output|p|param|pre|progress|q|rp|rt|ruby|samp|script|section|select|small|span|strike|strong|style|sub|sup|table|tbody|td|textarea|tfoot|th|thead|time|title|tr|tt|ul|var|video)\\b",relevance:0},{begin:":(visited|valid|root|right|required|read-write|read-only|out-range|optional|only-of-type|only-child|nth-of-type|nth-last-of-type|nth-last-child|nth-child|not|link|left|last-of-type|last-child|lang|invalid|indeterminate|in-range|hover|focus|first-of-type|first-line|first-letter|first-child|first|enabled|empty|disabled|default|checked|before|after|active)"},{begin:"::(after|before|choices|first-letter|first-line|repeat-index|repeat-item|selection|value)"},n,{className:"attribute",begin:"\\b(z-index|word-wrap|word-spacing|word-break|width|widows|white-space|visibility|vertical-align|unicode-bidi|transition-timing-function|transition-property|transition-duration|transition-delay|transition|transform-style|transform-origin|transform|top|text-underline-position|text-transform|text-shadow|text-rendering|text-overflow|text-indent|text-decoration-style|text-decoration-line|text-decoration-color|text-decoration|text-align-last|text-align|tab-size|table-layout|right|resize|quotes|position|pointer-events|perspective-origin|perspective|page-break-inside|page-break-before|page-break-after|padding-top|padding-right|padding-left|padding-bottom|padding|overflow-y|overflow-x|overflow-wrap|overflow|outline-width|outline-style|outline-offset|outline-color|outline|orphans|order|opacity|object-position|object-fit|normal|none|nav-up|nav-right|nav-left|nav-index|nav-down|min-width|min-height|max-width|max-height|mask|marks|margin-top|margin-right|margin-left|margin-bottom|margin|list-style-type|list-style-position|list-style-image|list-style|line-height|letter-spacing|left|justify-content|initial|inherit|ime-mode|image-orientation|image-resolution|image-rendering|icon|hyphens|height|font-weight|font-variant-ligatures|font-variant|font-style|font-stretch|font-size-adjust|font-size|font-language-override|font-kerning|font-feature-settings|font-family|font|float|flex-wrap|flex-shrink|flex-grow|flex-flow|flex-direction|flex-basis|flex|filter|empty-cells|display|direction|cursor|counter-reset|counter-increment|content|column-width|column-span|column-rule-width|column-rule-style|column-rule-color|column-rule|column-gap|column-fill|column-count|columns|color|clip-path|clip|clear|caption-side|break-inside|break-before|break-after|box-sizing|box-shadow|box-decoration-break|bottom|border-width|border-top-width|border-top-style|border-top-right-radius|border-top-left-radius|border-top-color|border-top|border-style|border-spacing|border-right-width|border-right-style|border-right-color|border-right|border-radius|border-left-width|border-left-style|border-left-color|border-left|border-image-width|border-image-source|border-image-slice|border-image-repeat|border-image-outset|border-image|border-color|border-collapse|border-bottom-width|border-bottom-style|border-bottom-right-radius|border-bottom-left-radius|border-bottom-color|border-bottom|border|background-size|background-repeat|background-position|background-origin|background-image|background-color|background-clip|background-attachment|background-blend-mode|background|backface-visibility|auto|animation-timing-function|animation-play-state|animation-name|animation-iteration-count|animation-fill-mode|animation-duration|animation-direction|animation-delay|animation|align-self|align-items|align-content)\\b",illegal:"[^\\s]"},{begin:"\\b(whitespace|wait|w-resize|visible|vertical-text|vertical-ideographic|uppercase|upper-roman|upper-alpha|underline|transparent|top|thin|thick|text|text-top|text-bottom|tb-rl|table-header-group|table-footer-group|sw-resize|super|strict|static|square|solid|small-caps|separate|se-resize|scroll|s-resize|rtl|row-resize|ridge|right|repeat|repeat-y|repeat-x|relative|progress|pointer|overline|outside|outset|oblique|nowrap|not-allowed|normal|none|nw-resize|no-repeat|no-drop|newspaper|ne-resize|n-resize|move|middle|medium|ltr|lr-tb|lowercase|lower-roman|lower-alpha|loose|list-item|line|line-through|line-edge|lighter|left|keep-all|justify|italic|inter-word|inter-ideograph|inside|inset|inline|inline-block|inherit|inactive|ideograph-space|ideograph-parenthesis|ideograph-numeric|ideograph-alpha|horizontal|hidden|help|hand|groove|fixed|ellipsis|e-resize|double|dotted|distribute|distribute-space|distribute-letter|distribute-all-lines|disc|disabled|default|decimal|dashed|crosshair|collapse|col-resize|circle|char|center|capitalize|break-word|break-all|bottom|both|bolder|bold|block|bidi-override|below|baseline|auto|always|all-scroll|absolute|table|table-cell)\\b"},{begin:":",end:";",contains:[n,t,e.CSS_NUMBER_MODE,e.QUOTE_STRING_MODE,e.APOS_STRING_MODE,{className:"meta",begin:"!important"}]},{begin:"@",end:"[{;]",keywords:"mixin include extend for if else each while charset import debug media page content font-face namespace warn",contains:[n,e.QUOTE_STRING_MODE,e.APOS_STRING_MODE,t,e.CSS_NUMBER_MODE,{begin:"\\s[A-Za-z0-9_.-]+",relevance:0}]}]}}),e.registerLanguage("shell",function(e){return{aliases:["console"],contains:[{className:"meta",begin:"^\\s{0,3}[\\w\\d\\[\\]()@-]*[>%$#]",starts:{end:"$",subLanguage:"bash"}}]}}),e.registerLanguage("yaml",function(e){var n="[a-zA-Z_][\\w\\-]*",t={className:"attr",variants:[{begin:"^[ \\-]*"+n+":"},{begin:'^[ \\-]*"'+n+'":'},{begin:"^[ \\-]*'"+n+"':"}]},a={className:"string",relevance:0,variants:[{begin:/'/,end:/'/},{begin:/"/,end:/"/},{begin:/\S+/}],contains:[e.BACKSLASH_ESCAPE,{className:"template-variable",variants:[{begin:"{{",end:"}}"},{begin:"%{",end:"}"}]}]};return{case_insensitive:!0,aliases:["yml","YAML","yaml"],contains:[t,{className:"meta",begin:"^---s*$",relevance:10},{className:"string",begin:"[\\|>] *$",returnEnd:!0,contains:a.contains,end:t.variants[0].begin},{begin:"<%[%=-]?",end:"[%-]?%>",subLanguage:"ruby",excludeBegin:!0,excludeEnd:!0,relevance:0},{className:"type",begin:"!"+e.UNDERSCORE_IDENT_RE},{className:"type",begin:"!!"+e.UNDERSCORE_IDENT_RE},{className:"meta",begin:"&"+e.UNDERSCORE_IDENT_RE+"$"},{className:"meta",begin:"\\*"+e.UNDERSCORE_IDENT_RE+"$"},{className:"bullet",begin:"^ *-",relevance:0},e.HASH_COMMENT_MODE,{beginKeywords:"true false yes no null",keywords:{literal:"true false yes no null"}},e.C_NUMBER_MODE,a]}})})(n)}()},dYcP:function(e,n){ | ||
/*! matchMedia() polyfill addListener/removeListener extension. Author & copyright (c) 2012: Scott Jehl. MIT license */ | ||
!function(){if(window.matchMedia&&window.matchMedia("all").addListener)return!1;var e=window.matchMedia,n=e("only all").matches,t=!1,a=0,i=[],r=function(n){clearTimeout(a),a=setTimeout(function(){for(var n=0,t=i.length;n<t;n++){var a=i[n].mql,r=i[n].listeners||[],s=e(a.media).matches;if(s!==a.matches){a.matches=s;for(var o=0,l=r.length;o<l;o++)r[o].call(window,a)}}},30)};window.matchMedia=function(a){var s=e(a),o=[],l=0;return s.addListener=function(e){n&&(t||(t=!0,window.addEventListener("resize",r,!0)),0===l&&(l=i.push({mql:s,listeners:o})),o.push(e))},s.removeListener=function(e){for(var n=0,t=o.length;n<t;n++)o[n]===e&&o.splice(n,1)},s}}()},kzB7:function(e,n){e.exports={colors:{"brand-colors":{"brand-orange":"#c75000","brand-blue":"#0d7fa5","brand-pink":"#aa0e5c"},"neutral-colors":{"light-gray":"#dedede",gray:"#555b5e","contrast-light":"#fff","contrast-dark":"#3b4042"},"theme-colors":{"theme-dark":"#0d7fa5","theme-light":"#cfe5ed",background:"#fff",text:"#3b4042","text-light":"#555b5e",action:"#b91e6c",focus:"#0d7fa5",underline:"#eec7da",border:"#555b5e","border-light":"#dedede",shadow:"rgba(85, 91, 94, 0.5)",callout:"#cfe5ed",slight:"#fafcfd",code:"#0d7fa5","code-shadow":"rgba(13, 127, 165, 0.2)"},"hljs-colors":{"hljs-comment":"#93a1a1","hljs-green":"#859900","hljs-cyan":"#2aa198","hljs-blue":"#268bd2","hljs-yellow":"#b58900","hljs-orange":"#cb4b16","hljs-red":"#dc322f","hljs-formula":"#eee8d5"},"demo-colors":{"brand-blue":"#0d7fa5","brand-pink":"#e2127a"},"demo-noncolors":{"light-gray":"#dedede",gray:"#555b5e","contrast-dark":"#3b4042"}},ratios:{"text-ratios":{"line-height":1.4},"demo-ratios":{"line-height":1.4}},sizes:{"root-sizes":{root:"18px",responsive:"calc(1em + 0.125vw)",large:"calc(1rem + 0.5vw)",small:"0.9rem"},"text-sizes":{reset:"1rem",h1:"calc(1rem + 2vw)",h2:"calc(1rem + 1vw)",h3:"calc(1rem + 0.5vw)",quote:"calc(1rem + 0.5vw)",code:"0.9rem",footer:"0.9rem",search:"0.9rem"},"spacing-sizes":{rhythm:"1.4rem",gutter:"1.4rem","gutter-plus":"2.1rem","double-gutter":"2.8rem","flex-gutter":"calc(0.7rem + 2.5vw)",spacer:"calc(4.2rem + 2.5vw)","gutter-minus":"1.05rem",shim:"0.7rem","half-shim":"0.35rem","quarter-shim":"0.175rem"},"pattern-sizes":{"nav-underline":"4px","nav-icon":"28px","arrow-border":"8px","arrow-depth":"0.7rem","arrow-side":"1.4rem","font-preview":"24em","specimen-aa":"4.2rem","color-preview":"16em","color-swatch":"5.6rem","footer-logo":"2.8rem"},"layout-sizes":{page:"50rem","item-break":"40em","page-break":"50em","nav-break":"65em"},"demo-sizes":{root:"18px",xlarge:"3rem"}},fonts:{sans:{name:"Source Sans Pro",source:"https://fonts.google.com/specimen/Source+Sans+Pro",stack:["Source Sans Pro","Helvetica Neue","Helvetica","Arial","sans-serif"]},code:{name:"Source Code Pro",source:"https://fonts.google.com/specimen/Source+Code+Pro",stack:["Source Code Pro","Consolas","Menlo","Monaco","Lucida Console","Liberation Mono","DejaVu Sans Mono","Bitstream Vera Sans Mono","Courier New","monospace","sans-serif"]},"demo-cdn":{name:"Source Code Pro",source:"https://fonts.google.com/specimen/Source+Code+Pro",stack:["Consolas","Menlo","Courier New","monospace","sans-serif"]},"demo-local":{name:"rockingham",normal:{path:"rockingham/rockingham-regular-webfont",local:"rockingham-regular-webfont"},bold:"rockingham/rockingham-bold-webfont",italic:"rockingham/rockingham-italic-webfont","bold italic":"rockingham/rockingham-bolditalic-webfont",stack:"fantasy",formats:["woff2","woff","ttf"]}}}},t3mS:function(e,n,t){"use strict";(function(e){t.d(n,"c",function(){return r}),t.d(n,"a",function(){return s}),t.d(n,"b",function(){return o});var a=t("kzB7"),i=t.n(a),r=function(){var n=e("body");n.on("toggle:close",'[data-toggle="button"]',function(){var n=e(this).attr("aria-controls"),t=e('[data-target-id="'.concat(n,'"]'));e('[data-toggle="button"][aria-controls="'.concat(n,'"][aria-pressed="true"]')).attr("aria-pressed","false"),t.trigger("target:close")}),n.on("toggle:open",'[data-toggle="button"]',function(){var n=e(this),t=n.attr("aria-controls"),a=e('[data-target-id="'.concat(t,'"]')),i=e('[data-toggle="button"][aria-controls="'.concat(t,'"]')).not(n);n.data("toggle-synced")?i.filter('[data-toggle-synced="true"]').attr("aria-pressed","true"):i.filter('[aria-pressed="true"]').attr("aria-pressed","false"),n.attr("aria-pressed","true"),a.trigger("target:open")}),n.on("target:close",'[data-toggle="target"]',function(n){var t=e(this);e(n.target).is(t)&&t.attr("aria-expanded","false")});var t=function(n){var t=n.attr("data-target-id"),a=e('[data-toggle="button"][aria-controls="'.concat(t,'"][aria-pressed="true"]'));a.length?a.trigger("toggle:close"):n.trigger("target:close")};n.on("target:open",'[data-toggle="target"]',function(n){var t=e(this);e(n.target).is(t)&&t.attr("aria-expanded","true")}),n.on("click",'[data-toggle="button"]',function(n){n.preventDefault();var t=e(this);"true"===t.attr("aria-pressed")?t.trigger("toggle:close"):t.trigger("toggle:open")}),n.on("click",'[data-toggle="close"]',function(n){n.preventDefault();var a=e('[data-target-id="'.concat(e(this).attr("aria-controls"),'"]'));t(a)});n.on("click",function(n){e('[data-toggle="target"][aria-expanded="true"][data-auto-closing="true"]').each(function(a,i){!function(e,n){var a=n.attr("data-target-id"),i=e.closest('[aria-controls="'.concat(a,'"]')).length,r=document.contains(e.get(0)),s=!e.closest(n).length,o=n.attr("data-auto-closing-exception"),l=!!o&&e.closest(o).length;!i&&(n.data("auto-closing-on-any-click")||r&&s&&!l)&&t(n)}(e(n.target),e(i))})})},s=function(){var n=function(n){n.contentWindow.document.body&&(n.height=e(n.contentWindow.document).outerHeight(!0))},t=function(){e("iframe").each(function(){n(this)})};t(),e("iframe").on("load",function(){n(this)}),e(window).on("resize",t)},o=function(){var n=i.a&&i.a.sizes&&i.a.sizes["layout-sizes"]&&i.a.sizes["layout-sizes"]["nav-break"];if(n){var t=e("#nav"),a=e('[aria-controls="nav"]'),r=window.matchMedia("(min-width: ".concat(n,")")),s=function(e){e.matches?t.attr("aria-expanded","true"):t.attr("aria-expanded",a.attr("aria-pressed"))};s(r),r.addListener(s)}}}).call(this,t("26+0"))}},[["+3Jt",0,1]]]); |
@@ -1,1 +0,1 @@ | ||
!function(r){function e(e){for(var t,p,a=e[0],c=e[1],f=e[2],l=0,s=[];l<a.length;l++)p=a[l],o[p]&&s.push(o[p][0]),o[p]=0;for(t in c)Object.prototype.hasOwnProperty.call(c,t)&&(r[t]=c[t]);for(i&&i(e);s.length;)s.shift()();return u.push.apply(u,f||[]),n()}function n(){for(var r,e=0;e<u.length;e++){for(var n=u[e],t=!0,a=1;a<n.length;a++){var c=n[a];0!==o[c]&&(t=!1)}t&&(u.splice(e--,1),r=p(p.s=n[0]))}return r}var t={},o={0:0},u=[];function p(e){if(t[e])return t[e].exports;var n=t[e]={i:e,l:!1,exports:{}};return r[e].call(n.exports,n,n.exports,p),n.l=!0,n.exports}p.m=r,p.c=t,p.d=function(r,e,n){p.o(r,e)||Object.defineProperty(r,e,{configurable:!1,enumerable:!0,get:n})},p.r=function(r){Object.defineProperty(r,"__esModule",{value:!0})},p.n=function(r){var e=r&&r.__esModule?function(){return r.default}:function(){return r};return p.d(e,"a",e),e},p.o=function(r,e){return Object.prototype.hasOwnProperty.call(r,e)},p.p="/assets/webpack/";var a=window.webpackJsonp=window.webpackJsonp||[],c=a.push.bind(a);a.push=e,a=a.slice();for(var f=0;f<a.length;f++)e(a[f]);var i=c;n()}([]); | ||
!function(e){function r(r){for(var n,f,i=r[0],l=r[1],a=r[2],c=0,s=[];c<i.length;c++)f=i[c],o[f]&&s.push(o[f][0]),o[f]=0;for(n in l)Object.prototype.hasOwnProperty.call(l,n)&&(e[n]=l[n]);for(p&&p(r);s.length;)s.shift()();return u.push.apply(u,a||[]),t()}function t(){for(var e,r=0;r<u.length;r++){for(var t=u[r],n=!0,i=1;i<t.length;i++){var l=t[i];0!==o[l]&&(n=!1)}n&&(u.splice(r--,1),e=f(f.s=t[0]))}return e}var n={},o={0:0},u=[];function f(r){if(n[r])return n[r].exports;var t=n[r]={i:r,l:!1,exports:{}};return e[r].call(t.exports,t,t.exports,f),t.l=!0,t.exports}f.m=e,f.c=n,f.d=function(e,r,t){f.o(e,r)||Object.defineProperty(e,r,{enumerable:!0,get:t})},f.r=function(e){"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(e,"__esModule",{value:!0})},f.t=function(e,r){if(1&r&&(e=f(e)),8&r)return e;if(4&r&&"object"==typeof e&&e&&e.__esModule)return e;var t=Object.create(null);if(f.r(t),Object.defineProperty(t,"default",{enumerable:!0,value:e}),2&r&&"string"!=typeof e)for(var n in e)f.d(t,n,function(r){return e[r]}.bind(null,n));return t},f.n=function(e){var r=e&&e.__esModule?function(){return e.default}:function(){return e};return f.d(r,"a",r),r},f.o=function(e,r){return Object.prototype.hasOwnProperty.call(e,r)},f.p="/assets/webpack/";var i=window.webpackJsonp=window.webpackJsonp||[],l=i.push.bind(i);i.push=r,i=i.slice();for(var a=0;a<i.length;a++)r(i[a]);var p=l;t()}([]); |
@@ -14,19 +14,14 @@ /* eslint-env node */ | ||
SASS_DIR: 'sass/', | ||
IGNORE: [ | ||
'!**/.#*', | ||
'!**/flycheck_*' | ||
], | ||
init: function () { | ||
this.SASS = [ | ||
this.SASS_DIR + '**/*.scss' | ||
].concat(this.IGNORE); | ||
IGNORE: ['!**/.#*', '!**/flycheck_*'], | ||
init: function() { | ||
this.SASS = [this.SASS_DIR + '**/*.scss'].concat(this.IGNORE); | ||
this.ALL_SASS = [ | ||
this.SASS_DIR + '**/*.scss', | ||
this.TEST_DIR + '**/*.scss' | ||
this.TEST_DIR + '**/*.scss', | ||
].concat(this.IGNORE); | ||
return this; | ||
} | ||
}, | ||
}.init(); | ||
var onError = function (err) { | ||
var onError = function(err) { | ||
log.error(chalk.red(err.message)); | ||
@@ -37,4 +32,5 @@ beeper(); | ||
var sasslintTask = function (src, failOnError) { | ||
var stream = gulp.src(src) | ||
var sasslintTask = function(src, failOnError) { | ||
var stream = gulp | ||
.src(src) | ||
.pipe(sasslint()) | ||
@@ -49,4 +45,4 @@ .pipe(sasslint.format()) | ||
gulp.task('sasslint', function () { | ||
gulp.task('sasslint', function() { | ||
return sasslintTask(paths.ALL_SASS); | ||
}); |
386
lib/main.js
@@ -0,1 +1,2 @@ | ||
var chalk = require('chalk'); | ||
var css = require('css'); | ||
@@ -6,3 +7,2 @@ var find = require('lodash.find'); | ||
var path = require('path'); | ||
var sass = require('node-sass'); | ||
@@ -33,25 +33,34 @@ // Tokens defining the True CSS output language. | ||
module.exports.runSass = function (options, describe, it, contextLines) { | ||
var runSass = function(sassOptions, trueOptions) { | ||
var sassOpts = Object.assign({}, sassOptions); | ||
var trueOpts = Object.assign({}, trueOptions); | ||
if (trueOpts.sass) { | ||
var sass = trueOpts.sass; | ||
} else { | ||
var sass = require('node-sass'); | ||
} | ||
var sassPath = path.join(__dirname, '..', 'sass'); | ||
if (options.includePaths) { | ||
options.includePaths.push(sassPath); | ||
if (sassOpts.includePaths) { | ||
sassOpts.includePaths.push(sassPath); | ||
} else { | ||
options.includePaths = [sassPath]; | ||
sassOpts.includePaths = [sassPath]; | ||
} | ||
var css = sass.renderSync(options).css.toString(); | ||
var modules = parse(css, contextLines); | ||
var css = sass.renderSync(sassOpts).css.toString(); | ||
var modules = parse(css, trueOpts.contextLines); | ||
forEach(modules, function (module) { | ||
describeModule(module, describe, it); | ||
forEach(modules, function(module) { | ||
describeModule(module, trueOpts.describe, trueOpts.it); | ||
}); | ||
}; | ||
var formatFailureMessage = module.exports.formatFailureMessage = function (assertion) { | ||
var msg = ( | ||
assertion.description + ' ("' + | ||
assertion.output + '" ' + | ||
assertion.assertionType + ' "' + | ||
assertion.expected + | ||
'"' | ||
); | ||
var formatFailureMessage = function(assertion) { | ||
var msg = | ||
assertion.description + | ||
' ("' + | ||
assertion.output + | ||
'" ' + | ||
assertion.assertionType + | ||
' "' + | ||
assertion.expected + | ||
'"'; | ||
if (assertion.details) { | ||
@@ -61,21 +70,19 @@ msg += ' -- ' + assertion.details; | ||
msg += ')'; | ||
msg += '\n ' + chalk.green('+ expected ') + chalk.red('- actual'); | ||
msg += '\n\n ' + chalk.red('-' + assertion.output); | ||
msg += '\n ' + chalk.green('+' + assertion.expected + '\n'); | ||
return msg; | ||
}; | ||
var describeModule = function (module, describe, it) { | ||
var describeModule = function(module, describe, it) { | ||
var assert = require('assert'); | ||
describe(module.module, function () { | ||
forEach(module.modules, function (submodule) { | ||
describe(module.module, function() { | ||
forEach(module.modules, function(submodule) { | ||
describeModule(submodule, describe, it); | ||
}); | ||
forEach(module.tests, function (test) { | ||
it(test.test, function () { | ||
forEach(test.assertions, function (assertion) { | ||
forEach(module.tests, function(test) { | ||
it(test.test, function() { | ||
forEach(test.assertions, function(assertion) { | ||
if (!assertion.passed) { | ||
assert.fail( | ||
assertion.output, | ||
assertion.expected, | ||
formatFailureMessage(assertion), | ||
assertion.assertionType | ||
); | ||
assert.fail(formatFailureMessage(assertion)); | ||
} | ||
@@ -88,8 +95,7 @@ }); | ||
var parse = module.exports.parse = function (rawCss, contextLines) { | ||
var contextLines = (typeof contextLines === 'undefined') ? 10 : contextLines; | ||
var parse = function(rawCss, contextLines) { | ||
var contextLines = typeof contextLines === 'undefined' ? 10 : contextLines; | ||
var lines = rawCss.split(/\r?\n/); | ||
var parseCss = function () { | ||
var parseCss = function() { | ||
var ast = css.parse(rawCss); | ||
@@ -99,3 +105,3 @@ var ctx = { modules: [] }; | ||
forEach(ast.stylesheet.rules, function (rule) { | ||
forEach(ast.stylesheet.rules, function(rule) { | ||
handler = handler(rule, ctx); | ||
@@ -107,28 +113,39 @@ }); | ||
return ctx.modules; | ||
} | ||
}; | ||
var parseError = function(msg, seeking, pos) { | ||
var errorMsg = | ||
'Line ' + | ||
pos.start.line + | ||
', ' + | ||
'column ' + | ||
pos.start.column + | ||
': ' + | ||
msg + | ||
'; ' + | ||
'looking for ' + | ||
seeking + | ||
'.\n' + | ||
'-- Context --\n' + | ||
lines | ||
.slice(Math.max(0, pos.start.line - contextLines), pos.start.line) | ||
.join('\n') + | ||
'\n' + | ||
' '.repeat(pos.start.column - 1) + | ||
'^\n'; | ||
return new Error(errorMsg); | ||
}; | ||
var parseError = function (msg, seeking, pos) { | ||
return new Error( | ||
'Line ' + pos.start.line + ', ' + | ||
'column ' + pos.start.column + ': ' + | ||
msg + '; ' + | ||
'looking for ' + seeking + '.\n' + | ||
'-- Context --\n' + | ||
lines.slice( | ||
Math.max(0, pos.start.line - contextLines), | ||
pos.start.line | ||
).join('\n') + '\n' + | ||
(' '.repeat(pos.start.column - 1)) + '^\n' | ||
); | ||
} | ||
var parseModule = function (rule, ctx) { | ||
var parseModule = function(rule, ctx) { | ||
if (rule.type === 'comment') { | ||
var text = rule.comment.trim(); | ||
if (!text) { return parseModule; } | ||
if (!text) { | ||
return parseModule; | ||
} | ||
if (startsWith(text, MODULE_TOKEN)) { | ||
finishCurrentModule(ctx); | ||
ctx.currentModule = { module: text.substring(MODULE_TOKEN.length), tests: [] }; | ||
ctx.currentModule = { | ||
module: text.substring(MODULE_TOKEN.length), | ||
tests: [], | ||
}; | ||
return parseTest; | ||
@@ -146,4 +163,3 @@ } | ||
var ignoreUntilEndSummary = function (rule, ctx) { | ||
var ignoreUntilEndSummary = function(rule, ctx) { | ||
if (rule.type === 'comment') { | ||
@@ -156,10 +172,15 @@ var text = rule.comment.trim(); | ||
} | ||
throw parseError('Unexpected rule type "' + rule.type + '"', 'end summary', rule.position); | ||
throw parseError( | ||
'Unexpected rule type "' + rule.type + '"', | ||
'end summary', | ||
rule.position | ||
); | ||
}; | ||
var parseTest = function (rule, ctx) { | ||
var parseTest = function(rule, ctx) { | ||
if (rule.type === 'comment') { | ||
var text = rule.comment.trim(); | ||
if (!text) { return parseTest; } | ||
if (!text) { | ||
return parseTest; | ||
} | ||
if (text.match(/^-+$/)) { | ||
@@ -170,3 +191,6 @@ return parseTest; | ||
finishCurrentTest(ctx); | ||
ctx.currentTest = { test: text.substring(TEST_TOKEN.length), assertions: [] }; | ||
ctx.currentTest = { | ||
test: text.substring(TEST_TOKEN.length), | ||
assertions: [], | ||
}; | ||
return parseAssertion; | ||
@@ -180,12 +204,14 @@ } | ||
var parseAssertion = function (rule, ctx) { | ||
var parseAssertion = function(rule, ctx) { | ||
if (rule.type === 'comment') { | ||
var text = rule.comment.trimLeft(); | ||
if (!text) { return parseAssertion; } | ||
if (!text) { | ||
return parseAssertion; | ||
} | ||
if (startsWith(text, PASS_TOKEN)) { | ||
finishCurrentAssertion(ctx); | ||
ctx.currentAssertion = { | ||
description: text.substring(PASS_TOKEN.length).trim() || '<no description>', | ||
passed: true | ||
description: | ||
text.substring(PASS_TOKEN.length).trim() || '<no description>', | ||
passed: true, | ||
}; | ||
@@ -199,3 +225,5 @@ return parseAssertion; | ||
passed: false, | ||
assertionType: text.substring(FAIL_TOKEN.length, endAssertionType).trim(), | ||
assertionType: text | ||
.substring(FAIL_TOKEN.length, endAssertionType) | ||
.trim(), | ||
}; | ||
@@ -207,3 +235,3 @@ return parseFailureDetail; | ||
description: text.substring(ASSERT_TOKEN.length).trim(), | ||
assertionType: 'equal' | ||
assertionType: 'equal', | ||
}; | ||
@@ -216,6 +244,5 @@ return parseAssertionOutputStart; | ||
return parseModule; | ||
} | ||
}; | ||
var parseFailureDetail = function (rule, ctx) { | ||
var parseFailureDetail = function(rule, ctx) { | ||
if (rule.type === 'comment') { | ||
@@ -242,3 +269,5 @@ var text = rule.comment.trim(); | ||
var key = detail.substring(0, splitAt); | ||
var value = detail.substring(splitAt + DETAILS_SEPARATOR_TOKEN.length); | ||
var value = detail.substring( | ||
splitAt + DETAILS_SEPARATOR_TOKEN.length | ||
); | ||
ctx.currentAssertion[key.toLowerCase()] = value; | ||
@@ -250,10 +279,15 @@ return parseFailureDetail; | ||
} | ||
throw parseError('Unexpected rule type "' + rule.type + '"', 'output/expected', rule.position); | ||
throw parseError( | ||
'Unexpected rule type "' + rule.type + '"', | ||
'output/expected', | ||
rule.position | ||
); | ||
}; | ||
var parseAssertionOutputStart = function (rule, ctx) { | ||
var parseAssertionOutputStart = function(rule, ctx) { | ||
if (rule.type === 'comment') { | ||
var text = rule.comment.trim(); | ||
if (!text) { return parseAssertionOutputStart; } | ||
if (!text) { | ||
return parseAssertionOutputStart; | ||
} | ||
if (text === OUTPUT_START_TOKEN) { | ||
@@ -263,13 +297,21 @@ ctx.currentOutputRules = []; | ||
} | ||
throw parseError('Unexpected comment "' + text + '"', 'OUTPUT', rule.position); | ||
throw parseError( | ||
'Unexpected comment "' + text + '"', | ||
'OUTPUT', | ||
rule.position | ||
); | ||
} | ||
throw parseError('Unexpected rule type "' + rule.type + '"', 'OUTPUT', rule.position); | ||
throw parseError( | ||
'Unexpected rule type "' + rule.type + '"', | ||
'OUTPUT', | ||
rule.position | ||
); | ||
}; | ||
var parseAssertionOutput = function (rule, ctx) { | ||
var parseAssertionOutput = function(rule, ctx) { | ||
if (rule.type === 'comment') { | ||
if (rule.comment.trim() === OUTPUT_END_TOKEN) { | ||
ctx.currentAssertion.output = css.stringify( | ||
{ stylesheet: { rules: ctx.currentOutputRules }}); | ||
ctx.currentAssertion.output = css.stringify({ | ||
stylesheet: { rules: ctx.currentOutputRules }, | ||
}); | ||
delete ctx.currentOutputRules; | ||
@@ -283,7 +325,8 @@ return parseAssertionExpectedStart; | ||
var parseAssertionExpectedStart = function (rule, ctx) { | ||
var parseAssertionExpectedStart = function(rule, ctx) { | ||
if (rule.type === 'comment') { | ||
var text = rule.comment.trim(); | ||
if (!text) { return parseAssertionExpectedStart; } | ||
if (!text) { | ||
return parseAssertionExpectedStart; | ||
} | ||
if (text === EXPECTED_START_TOKEN) { | ||
@@ -298,16 +341,24 @@ ctx.currentExpectedRules = []; | ||
} | ||
throw parseError('Unexpected comment "' + text + '"', 'EXPECTED', rule.position); | ||
throw parseError( | ||
'Unexpected comment "' + text + '"', | ||
'EXPECTED', | ||
rule.position | ||
); | ||
} | ||
throw parseError('Unexpected rule type "' + rule.type + '"', 'EXPECTED', rule.position); | ||
throw parseError( | ||
'Unexpected rule type "' + rule.type + '"', | ||
'EXPECTED', | ||
rule.position | ||
); | ||
}; | ||
var parseAssertionExpected = function (rule, ctx) { | ||
var parseAssertionExpected = function(rule, ctx) { | ||
if (rule.type === 'comment') { | ||
if (rule.comment.trim() === EXPECTED_END_TOKEN) { | ||
ctx.currentAssertion.expected = css.stringify( | ||
{ stylesheet: { rules: ctx.currentExpectedRules }}); | ||
ctx.currentAssertion.expected = css.stringify({ | ||
stylesheet: { rules: ctx.currentExpectedRules }, | ||
}); | ||
delete ctx.currentExpectedRules; | ||
ctx.currentAssertion.passed = ( | ||
ctx.currentAssertion.output === ctx.currentAssertion.expected); | ||
ctx.currentAssertion.passed = | ||
ctx.currentAssertion.output === ctx.currentAssertion.expected; | ||
return parseEndAssertion; | ||
@@ -320,7 +371,8 @@ } | ||
var parseEndAssertion = function (rule, ctx) { | ||
var parseEndAssertion = function(rule, ctx) { | ||
if (rule.type === 'comment') { | ||
var text = rule.comment.trim(); | ||
if (!text) { return parseEndAssertion; } | ||
if (!text) { | ||
return parseEndAssertion; | ||
} | ||
if (text === ASSERT_END_TOKEN) { | ||
@@ -330,15 +382,26 @@ finishCurrentAssertion(ctx); | ||
} | ||
throw parseError('Unexpected comment "' + text + '"', 'END_ASSERT', rule.position); | ||
throw parseError( | ||
'Unexpected comment "' + text + '"', | ||
'END_ASSERT', | ||
rule.position | ||
); | ||
} | ||
throw parseError('Unexpected rule type "' + rule.type + '"', 'END_ASSERT', rule.position); | ||
throw parseError( | ||
'Unexpected rule type "' + rule.type + '"', | ||
'END_ASSERT', | ||
rule.position | ||
); | ||
}; | ||
var parseAssertionContained = function (rule, ctx) { | ||
var parseAssertionContained = function(rule, ctx) { | ||
if (rule.type === 'comment') { | ||
if (rule.comment.trim() === CONTAINED_END_TOKEN) { | ||
ctx.currentAssertion.expected = css.stringify( | ||
{ stylesheet: { rules: ctx.currentExpectedRules }}); | ||
ctx.currentAssertion.expected = css.stringify({ | ||
stylesheet: { rules: ctx.currentExpectedRules }, | ||
}); | ||
delete ctx.currentExpectedRules; | ||
ctx.currentAssertion.passed = contains(ctx.currentAssertion.output, ctx.currentAssertion.expected); | ||
ctx.currentAssertion.passed = contains( | ||
ctx.currentAssertion.output, | ||
ctx.currentAssertion.expected | ||
); | ||
return parseEndAssertion; | ||
@@ -351,16 +414,15 @@ } | ||
return parseCss(); | ||
}; | ||
var falsyValues = function (item) { | ||
var falsyValues = function(item) { | ||
return Boolean(item); | ||
} | ||
}; | ||
var contains = function (output, expected) { | ||
var contains = function(output, expected) { | ||
var outputBlocks = createSelectorsRulesPairs(output); | ||
var expectedBlocks = createSelectorsRulesPairs(expected); | ||
var results = expectedBlocks.map(function (block) { | ||
var outputBlock = outputBlocks.find(function (element) { | ||
var results = expectedBlocks.map(function(block) { | ||
var outputBlock = outputBlocks.find(function(element) { | ||
return element.selector === block.selector; | ||
@@ -370,10 +432,13 @@ }); | ||
// Turns a css string into an array of property-value pairs. | ||
var expectedProperties = block.output.split(';').map(function(propertyValuePair) { | ||
return propertyValuePair.trim(); | ||
}).filter(function (block) { | ||
return block !== ' {' && block !== '}'; | ||
}); | ||
var expectedProperties = block.output | ||
.split(';') | ||
.map(function(propertyValuePair) { | ||
return propertyValuePair.trim(); | ||
}) | ||
.filter(function(block) { | ||
return block !== ' {' && block !== '}'; | ||
}); | ||
// This is the assertion itself! | ||
return expectedProperties.every(function (property) { | ||
return expectedProperties.every(function(property) { | ||
return outputBlock.output.includes(property); | ||
@@ -384,10 +449,12 @@ }); | ||
return results.every(function (result) { | ||
return results.every(function(result) { | ||
return result === true; | ||
}); | ||
} | ||
}; | ||
var createSelectorsRulesPairs = function (cssString) { | ||
var createSelectorsRulesPairs = function(cssString) { | ||
var processedMediaQueries = dealWithAnnoyingMediaQueries(cssString); | ||
var mediaQueries = splitSelectorAndProperties(processedMediaQueries.mediaQueryBasedSelectors); | ||
var mediaQueries = splitSelectorAndProperties( | ||
processedMediaQueries.mediaQueryBasedSelectors | ||
); | ||
var nonMediaQueries = processedMediaQueries.rawCSSSansMediaQueries; | ||
@@ -400,23 +467,25 @@ | ||
return splitBlocks.concat(mediaQueries).filter(falsyValues); | ||
} | ||
}; | ||
var splitSelectorAndProperties = function (blocks) { | ||
return blocks.map(function (block) { | ||
var splitSelectorAndProperties = function(blocks) { | ||
return blocks.map(function(block) { | ||
var temp = block.split('{'); | ||
var selector = temp[0]; | ||
var output = temp[1]; | ||
var splitBlock = { selector:selector , output:output }; | ||
var splitBlock = { selector: selector, output: output }; | ||
return splitBlock; | ||
}); | ||
} | ||
}; | ||
var removeNewLines = function (cssString) { | ||
var removeNewLines = function(cssString) { | ||
return cssString.replace(/\n/g, ''); | ||
} | ||
}; | ||
var cssStringToArrayOfRules = function (cssString) { | ||
return removeNewLines(cssString).split(/\s*}/g).filter(falsyValues); | ||
} | ||
var cssStringToArrayOfRules = function(cssString) { | ||
return removeNewLines(cssString) | ||
.split(/\s*}/g) | ||
.filter(falsyValues); | ||
}; | ||
var dealWithAnnoyingMediaQueries = function (rawCSS) { | ||
var dealWithAnnoyingMediaQueries = function(rawCSS) { | ||
var matchMediaQuery = /(@[a-zA-Z0-9:\(\)\s\-]+)/g; | ||
@@ -426,3 +495,6 @@ var matchCSSWithinMediaQueryBlock = /@[a-zA-Z0-9:()\s-]+{([a-zA-Z0-9:()\s-;\._\\n{}]+)(?!}\\n})/g; | ||
var mediaqueries = rawCSS.match(matchMediaQuery); | ||
var rawCSSSansMediaQueries = rawCSS.replace(matchMediaQuery,'').replace(matchCSSWithinMediaQueryBlock,'').replace(/^{/,''); | ||
var rawCSSSansMediaQueries = rawCSS | ||
.replace(matchMediaQuery, '') | ||
.replace(matchCSSWithinMediaQueryBlock, '') | ||
.replace(/^{/, ''); | ||
var matches = matchCSSWithinMediaQueryBlock.exec(rawCSS); | ||
@@ -435,3 +507,3 @@ var i = 0; | ||
if (matches.index === matchCSSWithinMediaQueryBlock.lastIndex) { | ||
matchCSSWithinMediaQueryBlock.lastIndex++; | ||
matchCSSWithinMediaQueryBlock.lastIndex++; | ||
} | ||
@@ -442,5 +514,7 @@ | ||
mediaQueryBasedSelectors = mediaQueryBasedSelectors.concat(cssRules.map(function(rule) { | ||
return mediaqueries[i] + rule; | ||
})); | ||
mediaQueryBasedSelectors = mediaQueryBasedSelectors.concat( | ||
cssRules.map(function(rule) { | ||
return mediaqueries[i] + rule; | ||
}) | ||
); | ||
@@ -453,7 +527,7 @@ i++; | ||
mediaQueryBasedSelectors: mediaQueryBasedSelectors, | ||
rawCSSSansMediaQueries: rawCSSSansMediaQueries | ||
rawCSSSansMediaQueries: rawCSSSansMediaQueries, | ||
}; | ||
} | ||
}; | ||
var finishCurrentModule = function (ctx) { | ||
var finishCurrentModule = function(ctx) { | ||
finishCurrentTest(ctx); | ||
@@ -466,6 +540,5 @@ if (ctx.currentModule) { | ||
} | ||
} | ||
}; | ||
var finishCurrentTest = function (ctx) { | ||
var finishCurrentTest = function(ctx) { | ||
finishCurrentAssertion(ctx); | ||
@@ -476,6 +549,5 @@ if (ctx.currentTest) { | ||
} | ||
} | ||
}; | ||
var finishCurrentAssertion = function (ctx) { | ||
var finishCurrentAssertion = function(ctx) { | ||
if (ctx.currentAssertion) { | ||
@@ -485,12 +557,13 @@ ctx.currentTest.assertions.push(ctx.currentAssertion); | ||
} | ||
} | ||
}; | ||
var insertModule = function(path, module, ctx) { | ||
if (!ctx.modules) { | ||
ctx.modules = []; | ||
} | ||
var insertModule = function (path, module, ctx) { | ||
if (!ctx.modules) { ctx.modules = [] }; | ||
if (path.length > 1) { | ||
var newCtx = find(ctx.modules, {module: path[0]}); | ||
var newCtx = find(ctx.modules, { module: path[0] }); | ||
if (!newCtx) { | ||
newCtx = {module: path[0]}; | ||
newCtx = { module: path[0] }; | ||
ctx.modules.push(newCtx); | ||
@@ -502,7 +575,12 @@ } | ||
} | ||
} | ||
}; | ||
var startsWith = function(text, token) { | ||
return text.substring(0, token.length) === token; | ||
}; | ||
var startsWith = function (text, token) { | ||
return text.substring(0, token.length) === token; | ||
} | ||
module.exports = { | ||
runSass: runSass, | ||
formatFailureMessage: formatFailureMessage, | ||
parse: parse, | ||
}; |
{ | ||
"name": "sass-true", | ||
"title": "True", | ||
"version": "4.0.0", | ||
"version": "5.0.0", | ||
"description": "Unit testing for Sass.", | ||
@@ -21,7 +21,7 @@ "homepage": "http://oddbird.net/true", | ||
"engines": { | ||
"node": ">=6" | ||
"node": ">=8" | ||
}, | ||
"dependencies": { | ||
"chalk": "^2.4.2", | ||
"css": "^2.2.1", | ||
"css-selector-parser": "^1.1.0", | ||
"lodash.find": "^4.6.0", | ||
@@ -32,18 +32,15 @@ "lodash.foreach": "^4.5.0", | ||
"devDependencies": { | ||
"beeper": "^1.1.1", | ||
"beeper": "^2.0.0", | ||
"chai": "^4.1.2", | ||
"chalk": "^2.3.2", | ||
"coveralls": "^3.0.0", | ||
"fancy-log": "^1.3.2", | ||
"gulp": "^4.0.0", | ||
"coveralls": "^3.0.3", | ||
"fancy-log": "^1.3.3", | ||
"gulp": "^4.0.2", | ||
"gulp-sass-lint": "^1.3.4", | ||
"mocha": "^5.0.5", | ||
"node-sass": "^4.8.3", | ||
"nyc": "^11.6.0", | ||
"sassdoc": "^2.5.0", | ||
"sassdoc-theme-herman": "^2.1.0" | ||
"jest": "^24.8.0", | ||
"mocha": "^6.1.4", | ||
"node-sass": "^4.12.0", | ||
"nyc": "^14.1.1", | ||
"sassdoc": "^2.7.0", | ||
"sassdoc-theme-herman": "^3.0.2" | ||
}, | ||
"peerDependencies": { | ||
"node-sass": "^4.0.0" | ||
}, | ||
"eyeglass": { | ||
@@ -56,3 +53,5 @@ "needs": "^1.0", | ||
"scripts": { | ||
"test": "nyc --reporter=html --reporter=text mocha", | ||
"test": "yarn test:mocha; yarn test:jest", | ||
"test:mocha": "nyc --reporter=html --reporter=text mocha", | ||
"test:jest": "jest --testRegex test_sass", | ||
"coverage": "nyc report --reporter=text-lcov | coveralls", | ||
@@ -62,3 +61,3 @@ "debug": "mocha debug", | ||
"compile": "node-sass test/scss/test.scss test/css/test.css --include-path ./sass/", | ||
"commit": "npm test; npm run compile; gulp sasslint; npm run sassdoc" | ||
"commit": "yarn test; yarn compile; gulp sasslint; yarn sassdoc" | ||
}, | ||
@@ -65,0 +64,0 @@ "author": "Miriam Suzanne <miriam@oddbird.net>", |
145
README.md
@@ -5,3 +5,2 @@ # True | ||
[![Coverage Status](https://coveralls.io/repos/github/oddbird/true/badge.svg?branch=master)](https://coveralls.io/github/oddbird/true?branch=master) | ||
[![Greenkeeper badge](https://badges.greenkeeper.io/oddbird/true.svg)](https://greenkeeper.io/) | ||
[![License](https://img.shields.io/badge/License-BSD%203--Clause-blue.svg)](https://opensource.org/licenses/BSD-3-Clause) | ||
@@ -16,3 +15,4 @@ | ||
but we also provide integration with | ||
[Mocha JS](https://mochajs.org/), | ||
JavaScript test runners | ||
(e.g. [Mocha](https://mochajs.org/) or [Jest](https://jestjs.io/)), | ||
for extra features and improved reporting. | ||
@@ -24,14 +24,12 @@ | ||
*True the wheels of a bicycle after striking a pothole.* | ||
_True the wheels of a bicycle after striking a pothole._ | ||
2. To make even, symmetrical, level, etc. (often followed by *up*): | ||
2. To make even, symmetrical, level, etc. (often followed by _up_): | ||
*True up the sides of a door.* | ||
_True up the sides of a door._ | ||
3. To test your Sass code; debug, perfect, etc. (often using *True*): | ||
3. To test your Sass code; debug, perfect, etc. (often using _True_): | ||
*True your sweet plugin before you deploy.* | ||
_True your sweet plugin before you deploy._ | ||
## Install | ||
@@ -49,3 +47,3 @@ | ||
```scss | ||
@import "true"; | ||
@import 'true'; | ||
``` | ||
@@ -58,6 +56,5 @@ | ||
// This is only an example | ||
@import "../node_modules/sass-true/sass/true"; | ||
@import '../node_modules/sass-true/sass/true'; | ||
``` | ||
## One Setting | ||
@@ -69,8 +66,7 @@ | ||
- `true` will show detailed information in the terminal | ||
for debugging failed assertions, or reporting final results. | ||
This is the default, and best for compiling without Mocha. | ||
for debugging failed assertions or reporting final results. | ||
This is the default, and best for compiling without a JavaScript test runner. | ||
- `false` will turn off all terminal output from Sass, | ||
though Mocha will continue to use the terminal for reporting. | ||
though Mocha/Jest will continue to use the terminal for reporting. | ||
## Usage | ||
@@ -85,8 +81,4 @@ | ||
@include test('Zips multiple lists into a single multi-dimensional list') { | ||
// Assert the expected results | ||
@include assert-equal( | ||
zip(a b c, 1 2 3), | ||
(a 1, b 2, c 3) | ||
); | ||
@include assert-equal(zip(a b c, 1 2 3), (a 1, b 2, c 3)); | ||
} | ||
@@ -101,8 +93,4 @@ } | ||
@include it('Zips multiple lists into a single multi-dimensional list') { | ||
// Assert the expected results | ||
@include assert-equal( | ||
zip(a b c, 1 2 3), | ||
(a 1, b 2, c 3) | ||
); | ||
@include assert-equal(zip(a b c, 1 2 3), (a 1, b 2, c 3)); | ||
} | ||
@@ -120,3 +108,4 @@ } | ||
(`git diff` is helpful for noticing changes), | ||
or you can use our [Mocha JS](https://mochajs.org/) integration. | ||
or you can use | ||
our [Mocha](https://mochajs.org/) or [Jest](https://jestjs.io/) integration. | ||
@@ -159,18 +148,27 @@ Output tests fit the same structure, | ||
## Using Mocha, Jest, or other JS test runners | ||
## Using Mocha (or other JS test runners) | ||
1. Install `true` via npm: | ||
```bash | ||
npm install sass-true | ||
npm install --save-dev sass-true | ||
``` | ||
2. [Optional] Install `node-sass` (required as a `peerDependency`), | ||
if it's not already installed in your project: | ||
2. [Optional] Install the Sass implementation matching your project | ||
(if not already installed). | ||
Either `node-sass`: | ||
```bash | ||
npm install node-sass | ||
npm install --save-dev node-sass | ||
``` | ||
or `sass` (also `dart-sass`): | ||
```bash | ||
npm install --save-dev sass | ||
``` | ||
> _Note_ `sass`/`dart-sass` has [a few differences from `node-sass`](https://github.com/sass/dart-sass/#behavioral-differences-from-ruby-sass). | ||
3. Write some Sass tests in `test/test.scss` (see above). | ||
@@ -180,2 +178,4 @@ | ||
**For `node-sass`**: | ||
```js | ||
@@ -186,7 +186,26 @@ var path = require('path'); | ||
var sassFile = path.join(__dirname, 'test.scss'); | ||
sassTrue.runSass({file: sassFile}, describe, it); | ||
sassTrue.runSass({ file: sassFile }, { describe, it }); | ||
``` | ||
5. Run Mocha, and see your Sass tests reported in the command line. | ||
**For `sass`/`dart-sass`**: | ||
```js | ||
var path = require('path'); | ||
var sassTrue = require('sass-true'); | ||
var sassFile = path.join(__dirname, 'test.scss'); | ||
sassTrue.runSass( | ||
{ | ||
file: sassFile, | ||
}, | ||
{ | ||
sass: require('sass'), | ||
describe, | ||
it, | ||
} | ||
); | ||
``` | ||
5. Run Mocha/Jest, and see your Sass tests reported in the command line. | ||
You can call `runSass` more than once, if you have multiple Sass test files you | ||
@@ -201,45 +220,25 @@ want to run separately. | ||
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`. | ||
The second argument is an object with required `describe` and `it` options, and | ||
optional `contextLines` and `sass` options. | ||
If True's Mocha plugin can't parse the CSS output from True, it'll give you | ||
some context lines of CSS as part of the error message. This context will | ||
likely be helpful in understanding the parse failure. By default it provides up | ||
to 10 lines of context; if you need more, you can provide a numeric fourth | ||
argument to `runSass`, the maximum number of context lines to provide. | ||
Any JS test runner with equivalents to Mocha's or Jest's `describe` and `it` | ||
should be usable in the same way: just pass your test runner's `describe` and | ||
`it` equivalents in the second argument to `runSass`. | ||
If True can't parse the CSS output, it'll give you some context lines of CSS as | ||
part of the error message. This context will likely be helpful in understanding | ||
the parse failure. By default it provides up to 10 lines of context; if you need | ||
more, you can provide a numeric `contextLines` option: the maximum number of | ||
context lines to provide. | ||
### …With Grunt… | ||
You can also provide a `sass` option to provide a different Sass implementation | ||
(for example, using `sass`/`dart-sass` instead of `node-sass`). This option | ||
expects an object providing a `renderSync` method with the same signature as | ||
`node-sass`. | ||
Run Mocha using the Grunt task supplied by | ||
[grunt-mocha-cli](https://github.com/Rowno/grunt-mocha-cli) | ||
Install `grunt-mocha-cli`: | ||
```bash | ||
npm install grunt-mocha-cli --save-dev | ||
``` | ||
Configure task: | ||
```js | ||
grunt.loadNpmTasks('grunt-mocha'); | ||
mochacli: { | ||
all: ['test/test_sass.js'] | ||
}, | ||
``` | ||
Run tests: | ||
```bash | ||
grunt mochacli | ||
``` | ||
### Imports without Webpack | ||
If you use Webpack's tilde notation, like `@import | ||
'~accoutrement-init/sass/init'`, you'll need to tell `runSass` how to handle | ||
that. That will require writing a custom importer and passing it into the | ||
If you use Webpack's tilde notation, like | ||
`@import '~accoutrement-init/sass/init'`, you'll need to tell `runSass` how to | ||
handle that. That will require writing a custom importer and passing it into the | ||
configuration for `runSass`. Something like: | ||
@@ -256,3 +255,3 @@ | ||
sassTrue.runSass({ importer, file: sassFile }, describe, it); | ||
sassTrue.runSass({ importer, file: sassFile }, { describe, it }); | ||
``` |
{ | ||
"name": "true", | ||
"description": "Unit testing for Sass.", | ||
"tags": [ | ||
"unit-test", "test", "sass", "libsass", "TDD" | ||
] | ||
"tags": ["unit-test", "test", "sass", "libsass", "TDD"] | ||
} |
@@ -0,8 +1,9 @@ | ||
var chalk = require('chalk'); | ||
var expect = require('chai').expect; | ||
var main = require('../lib/main.js'); | ||
var path = require('path'); | ||
var main = require('../lib/main.js'); | ||
describe('#fail', function () { | ||
it('formats failure message', function () { | ||
describe('#fail', function() { | ||
it('formats failure message', function() { | ||
var msg = main.formatFailureMessage({ | ||
@@ -13,12 +14,20 @@ description: 'It broke.', | ||
output: '2', | ||
details: 'It really broke.' | ||
details: 'It really broke.', | ||
}); | ||
var expected = | ||
'It broke. ("2" assert-equal "1" -- It really broke.)' + | ||
'\n ' + | ||
chalk.green('+ expected ') + | ||
chalk.red('- actual') + | ||
'\n\n ' + | ||
chalk.red('-2') + | ||
'\n ' + | ||
chalk.green('+1\n'); | ||
expect(msg).to.equal('It broke. ("2" assert-equal "1" -- It really broke.)'); | ||
expect(msg).to.equal(expected); | ||
}); | ||
}); | ||
describe('#runSass', function () { | ||
it('throws AssertionError on failure', function () { | ||
describe('#runSass', function() { | ||
it('throws AssertionError on failure', function() { | ||
var sass = [ | ||
@@ -30,13 +39,16 @@ '@import "true";', | ||
' }', | ||
'}' | ||
'}', | ||
].join('\n'); | ||
var mock = function (name, cb) { cb(); }; | ||
var attempt = function () { | ||
main.runSass({data: sass}, mock, mock); | ||
var mock = function(name, cb) { | ||
cb(); | ||
}; | ||
var attempt = function() { | ||
main.runSass({ data: sass }, { describe: mock, it: mock }); | ||
}; | ||
expect(attempt).to.throw( | ||
'This test is meant to fail. ("[bool] false" assert-true "[bool] true")'); | ||
'This test is meant to fail. ("[bool] false" assert-true "[bool] true")' | ||
); | ||
}); | ||
it('can specify includePaths', function () { | ||
it('can specify includePaths', function() { | ||
var sass = [ | ||
@@ -56,17 +68,45 @@ '@import "include";', | ||
' }', | ||
'}' | ||
'}', | ||
].join('\n'); | ||
var mock = function (name, cb) { cb(); }; | ||
var mock = function(name, cb) { | ||
cb(); | ||
}; | ||
main.runSass( | ||
{ | ||
data: sass, | ||
includePaths: [path.join(__dirname, 'scss/includes')] | ||
includePaths: [path.join(__dirname, 'scss/includes')], | ||
}, | ||
mock, | ||
mock); | ||
{ | ||
describe: mock, | ||
it: mock, | ||
} | ||
); | ||
}); | ||
it('can specify sass engine to use', function() { | ||
var mock = function(name, cb) { | ||
cb(); | ||
}; | ||
var attempt = function() { | ||
main.runSass( | ||
{ | ||
data: '', | ||
}, | ||
{ | ||
sass: { | ||
renderSync: function() { | ||
throw new Error('Custom sass implementation called'); | ||
}, | ||
}, | ||
describe: mock, | ||
it: mock, | ||
} | ||
); | ||
}; | ||
expect(attempt).to.throw('Custom sass implementation called'); | ||
}); | ||
}); | ||
describe('#parse', function () { | ||
it('parses a passing non-output test', function () { | ||
describe('#parse', function() { | ||
it('parses a passing non-output test', function() { | ||
var css = [ | ||
@@ -76,14 +116,20 @@ '/* # Module: Utilities */', | ||
'/* Test: Map Add [function] */', | ||
'/* ✔ Returns the sum of two numeric maps */' | ||
'/* ✔ Returns the sum of two numeric maps */', | ||
].join('\n'); | ||
var expected = [{ | ||
module: "Utilities", | ||
tests: [{ | ||
test: "Map Add [function]", | ||
assertions: [{ | ||
description: "Returns the sum of two numeric maps", | ||
passed: true, | ||
}], | ||
}], | ||
}]; | ||
var expected = [ | ||
{ | ||
module: 'Utilities', | ||
tests: [ | ||
{ | ||
test: 'Map Add [function]', | ||
assertions: [ | ||
{ | ||
description: 'Returns the sum of two numeric maps', | ||
passed: true, | ||
}, | ||
], | ||
}, | ||
], | ||
}, | ||
]; | ||
@@ -93,3 +139,3 @@ expect(main.parse(css)).to.deep.equal(expected); | ||
it('ignores a summary', function () { | ||
it('ignores a summary', function() { | ||
var css = [ | ||
@@ -108,3 +154,3 @@ '/* # SUMMARY ---------- */', | ||
it('parses a passing non-output test sans description', function () { | ||
it('parses a passing non-output test sans description', function() { | ||
var css = [ | ||
@@ -114,14 +160,20 @@ '/* # Module: Utilities */', | ||
'/* Test: Map Add [function] */', | ||
'/* ✔ */' | ||
'/* ✔ */', | ||
].join('\n'); | ||
var expected = [{ | ||
module: "Utilities", | ||
tests: [{ | ||
test: "Map Add [function]", | ||
assertions: [{ | ||
description: "<no description>", | ||
passed: true, | ||
}], | ||
}], | ||
}]; | ||
var expected = [ | ||
{ | ||
module: 'Utilities', | ||
tests: [ | ||
{ | ||
test: 'Map Add [function]', | ||
assertions: [ | ||
{ | ||
description: '<no description>', | ||
passed: true, | ||
}, | ||
], | ||
}, | ||
], | ||
}, | ||
]; | ||
@@ -131,3 +183,3 @@ expect(main.parse(css)).to.deep.equal(expected); | ||
it('parses a test following a summary', function () { | ||
it('parses a test following a summary', function() { | ||
var css = [ | ||
@@ -143,14 +195,20 @@ '/* # SUMMARY ---------- */', | ||
'/* Test: Map Add [function] */', | ||
'/* ✔ Returns the sum of two numeric maps */' | ||
'/* ✔ Returns the sum of two numeric maps */', | ||
].join('\n'); | ||
var expected = [{ | ||
module: "Utilities", | ||
tests: [{ | ||
test: "Map Add [function]", | ||
assertions: [{ | ||
description: "Returns the sum of two numeric maps", | ||
passed: true, | ||
}], | ||
}], | ||
}]; | ||
var expected = [ | ||
{ | ||
module: 'Utilities', | ||
tests: [ | ||
{ | ||
test: 'Map Add [function]', | ||
assertions: [ | ||
{ | ||
description: 'Returns the sum of two numeric maps', | ||
passed: true, | ||
}, | ||
], | ||
}, | ||
], | ||
}, | ||
]; | ||
@@ -160,3 +218,3 @@ expect(main.parse(css)).to.deep.equal(expected); | ||
it('parses a nested passing non-output test', function () { | ||
it('parses a nested passing non-output test', function() { | ||
var css = [ | ||
@@ -166,17 +224,25 @@ '/* # Module: Utilities :: nested */', | ||
'/* Test: Map Add [function] */', | ||
'/* ✔ Returns the sum of two numeric maps */' | ||
'/* ✔ Returns the sum of two numeric maps */', | ||
].join('\n'); | ||
var expected = [{ | ||
module: "Utilities", | ||
modules: [{ | ||
module: "nested", | ||
tests: [{ | ||
test: "Map Add [function]", | ||
assertions: [{ | ||
description: "Returns the sum of two numeric maps", | ||
passed: true, | ||
}], | ||
}], | ||
}], | ||
}]; | ||
var expected = [ | ||
{ | ||
module: 'Utilities', | ||
modules: [ | ||
{ | ||
module: 'nested', | ||
tests: [ | ||
{ | ||
test: 'Map Add [function]', | ||
assertions: [ | ||
{ | ||
description: 'Returns the sum of two numeric maps', | ||
passed: true, | ||
}, | ||
], | ||
}, | ||
], | ||
}, | ||
], | ||
}, | ||
]; | ||
@@ -186,3 +252,3 @@ expect(main.parse(css)).to.deep.equal(expected); | ||
it('parses a failing non-output test', function () { | ||
it('parses a failing non-output test', function() { | ||
var css = [ | ||
@@ -195,18 +261,24 @@ '/* # Module: Assert */', | ||
'/* - Expected: [bool] true */', | ||
'/* - Details: Broken tautology is broken. */' | ||
'/* - Details: Broken tautology is broken. */', | ||
].join('\n'); | ||
var expected = [{ | ||
module: "Assert", | ||
tests: [{ | ||
test: "Simple assertions", | ||
assertions: [{ | ||
description: "True should assert true.", | ||
passed: false, | ||
assertionType: 'assert-true', | ||
output: '[bool] false', | ||
expected: '[bool] true', | ||
details: 'Broken tautology is broken.' | ||
}], | ||
}], | ||
}]; | ||
var expected = [ | ||
{ | ||
module: 'Assert', | ||
tests: [ | ||
{ | ||
test: 'Simple assertions', | ||
assertions: [ | ||
{ | ||
description: 'True should assert true.', | ||
passed: false, | ||
assertionType: 'assert-true', | ||
output: '[bool] false', | ||
expected: '[bool] true', | ||
details: 'Broken tautology is broken.', | ||
}, | ||
], | ||
}, | ||
], | ||
}, | ||
]; | ||
@@ -216,3 +288,3 @@ expect(main.parse(css)).to.deep.equal(expected); | ||
it('parses a failing non-output test with no failure details', function () { | ||
it('parses a failing non-output test with no failure details', function() { | ||
var css = [ | ||
@@ -223,21 +295,25 @@ '/* # Module: Assert */', | ||
'/* ✖ FAILED: [assert-true] True should assert true. */', | ||
'/* ✔ False should assert false */' | ||
'/* ✔ False should assert false */', | ||
].join('\n'); | ||
var expected = [{ | ||
module: "Assert", | ||
tests: [{ | ||
test: "Simple assertions", | ||
assertions: [ | ||
var expected = [ | ||
{ | ||
module: 'Assert', | ||
tests: [ | ||
{ | ||
description: "True should assert true.", | ||
passed: false, | ||
assertionType: 'assert-true' | ||
test: 'Simple assertions', | ||
assertions: [ | ||
{ | ||
description: 'True should assert true.', | ||
passed: false, | ||
assertionType: 'assert-true', | ||
}, | ||
{ | ||
description: 'False should assert false', | ||
passed: true, | ||
}, | ||
], | ||
}, | ||
{ | ||
description: "False should assert false", | ||
passed: true | ||
} | ||
], | ||
}], | ||
}]; | ||
}, | ||
]; | ||
@@ -247,3 +323,3 @@ expect(main.parse(css)).to.deep.equal(expected); | ||
it('parses a passing output test', function () { | ||
it('parses a passing output test', function() { | ||
var css = [ | ||
@@ -266,17 +342,23 @@ '/* # Module: Assert */', | ||
'/* */', | ||
'/* END_ASSERT */' | ||
'/* END_ASSERT */', | ||
].join('\n'); | ||
var expected = [{ | ||
module: "Assert", | ||
tests: [{ | ||
test: "CSS output assertions", | ||
assertions: [{ | ||
description: "Input and output selector patterns match", | ||
assertionType: 'equal', | ||
passed: true, | ||
output: '.test-output {\n -property: value;\n}', | ||
expected: '.test-output {\n -property: value;\n}' | ||
}], | ||
}], | ||
}]; | ||
var expected = [ | ||
{ | ||
module: 'Assert', | ||
tests: [ | ||
{ | ||
test: 'CSS output assertions', | ||
assertions: [ | ||
{ | ||
description: 'Input and output selector patterns match', | ||
assertionType: 'equal', | ||
passed: true, | ||
output: '.test-output {\n -property: value;\n}', | ||
expected: '.test-output {\n -property: value;\n}', | ||
}, | ||
], | ||
}, | ||
], | ||
}, | ||
]; | ||
@@ -286,3 +368,3 @@ expect(main.parse(css)).to.deep.equal(expected); | ||
it('parses a passing output test with loud comments', function () { | ||
it('parses a passing output test with loud comments', function() { | ||
var css = [ | ||
@@ -308,17 +390,25 @@ '/* Some random loud comment */', | ||
'/* */', | ||
'/* END_ASSERT */' | ||
'/* END_ASSERT */', | ||
].join('\n'); | ||
var expected = [{ | ||
module: "Assert", | ||
tests: [{ | ||
test: "CSS output assertions", | ||
assertions: [{ | ||
description: "Input and output selector patterns match", | ||
assertionType: 'equal', | ||
passed: true, | ||
output: '/* Some loud comment */\n\n.test-output {\n -property: value;\n}', | ||
expected: '/* Some loud comment */\n\n.test-output {\n -property: value;\n}' | ||
}], | ||
}], | ||
}]; | ||
var expected = [ | ||
{ | ||
module: 'Assert', | ||
tests: [ | ||
{ | ||
test: 'CSS output assertions', | ||
assertions: [ | ||
{ | ||
description: 'Input and output selector patterns match', | ||
assertionType: 'equal', | ||
passed: true, | ||
output: | ||
'/* Some loud comment */\n\n.test-output {\n -property: value;\n}', | ||
expected: | ||
'/* Some loud comment */\n\n.test-output {\n -property: value;\n}', | ||
}, | ||
], | ||
}, | ||
], | ||
}, | ||
]; | ||
@@ -328,3 +418,3 @@ expect(main.parse(css)).to.deep.equal(expected); | ||
it('parses a failing output test', function () { | ||
it('parses a failing output test', function() { | ||
var css = [ | ||
@@ -344,17 +434,23 @@ '/* # Module: Assert */', | ||
'/* END_EXPECTED */', | ||
'/* END_ASSERT */' | ||
'/* END_ASSERT */', | ||
].join('\n'); | ||
var expected = [{ | ||
module: "Assert", | ||
tests: [{ | ||
test: "CSS output assertions", | ||
assertions: [{ | ||
description: "Input and output selector patterns match", | ||
assertionType: 'equal', | ||
passed: false, | ||
expected: '.test-output {\n -property: value2;\n}', | ||
output: '.test-output {\n -property: value1;\n}' | ||
}], | ||
}], | ||
}]; | ||
var expected = [ | ||
{ | ||
module: 'Assert', | ||
tests: [ | ||
{ | ||
test: 'CSS output assertions', | ||
assertions: [ | ||
{ | ||
description: 'Input and output selector patterns match', | ||
assertionType: 'equal', | ||
passed: false, | ||
expected: '.test-output {\n -property: value2;\n}', | ||
output: '.test-output {\n -property: value1;\n}', | ||
}, | ||
], | ||
}, | ||
], | ||
}, | ||
]; | ||
@@ -364,3 +460,3 @@ expect(main.parse(css)).to.deep.equal(expected); | ||
it('respects declaration order in output tests', function () { | ||
it('respects declaration order in output tests', function() { | ||
var css = [ | ||
@@ -383,17 +479,25 @@ '/* # Module: Assert */', | ||
'/* END_EXPECTED */', | ||
'/* END_ASSERT */' | ||
'/* END_ASSERT */', | ||
].join('\n'); | ||
var expected = [{ | ||
module: "Assert", | ||
tests: [{ | ||
test: "CSS output assertions", | ||
assertions: [{ | ||
description: "Input and output selector patterns match", | ||
assertionType: 'equal', | ||
passed: false, | ||
expected: '.test-output {\n -property1: value1;\n -property2: value2;\n}', | ||
output: '.test-output {\n -property2: value2;\n -property1: value1;\n}', | ||
}], | ||
}], | ||
}]; | ||
var expected = [ | ||
{ | ||
module: 'Assert', | ||
tests: [ | ||
{ | ||
test: 'CSS output assertions', | ||
assertions: [ | ||
{ | ||
description: 'Input and output selector patterns match', | ||
assertionType: 'equal', | ||
passed: false, | ||
expected: | ||
'.test-output {\n -property1: value1;\n -property2: value2;\n}', | ||
output: | ||
'.test-output {\n -property2: value2;\n -property1: value1;\n}', | ||
}, | ||
], | ||
}, | ||
], | ||
}, | ||
]; | ||
@@ -403,3 +507,3 @@ expect(main.parse(css)).to.deep.equal(expected); | ||
it('parses tests of comment output', function () { | ||
it('parses tests of comment output', function() { | ||
var css = [ | ||
@@ -419,15 +523,21 @@ '/* # Module: True Message */', | ||
].join('\n'); | ||
var expected = [{ | ||
module: "True Message", | ||
tests: [{ | ||
test: "Simple messages", | ||
assertions: [{ | ||
description: "Render as CSS comments", | ||
assertionType: 'equal', | ||
passed: true, | ||
expected: '/* This is a simple message */', | ||
output: '/* This is a simple message */', | ||
}], | ||
}], | ||
}]; | ||
var expected = [ | ||
{ | ||
module: 'True Message', | ||
tests: [ | ||
{ | ||
test: 'Simple messages', | ||
assertions: [ | ||
{ | ||
description: 'Render as CSS comments', | ||
assertionType: 'equal', | ||
passed: true, | ||
expected: '/* This is a simple message */', | ||
output: '/* This is a simple message */', | ||
}, | ||
], | ||
}, | ||
], | ||
}, | ||
]; | ||
@@ -437,3 +547,3 @@ expect(main.parse(css)).to.deep.equal(expected); | ||
it('ignores unexpected rule types', function () { | ||
it('ignores unexpected rule types', function() { | ||
var css = '.foo { -prop: value; }'; | ||
@@ -444,74 +554,78 @@ | ||
it('throws error on unexpected rule type instead of end summary', function () { | ||
var css = [ | ||
'/* # SUMMARY ---------- */', | ||
'.foo { -prop: value; }', | ||
].join('\n'); | ||
var attempt = function () { main.parse(css); }; | ||
it('throws error on unexpected rule type instead of end summary', function() { | ||
var css = ['/* # SUMMARY ---------- */', '.foo { -prop: value; }'].join( | ||
'\n' | ||
); | ||
var attempt = function() { | ||
main.parse(css); | ||
}; | ||
expect(attempt).to.throw([ | ||
'Line 2, column 1: Unexpected rule type "rule"; looking for end summary.', | ||
'-- Context --', | ||
'/* # SUMMARY ---------- */', | ||
'.foo { -prop: value; }', | ||
'^' | ||
].join('\n')); | ||
expect(attempt).to.throw( | ||
[ | ||
'Line 2, column 1: Unexpected rule type "rule"; looking for end summary.', | ||
'-- Context --', | ||
'/* # SUMMARY ---------- */', | ||
'.foo { -prop: value; }', | ||
'^', | ||
].join('\n') | ||
); | ||
}); | ||
it('accepts a number of context lines to display on error', function () { | ||
var css = [ | ||
'/* # SUMMARY ---------- */', | ||
'.foo { -prop: value; }', | ||
].join('\n'); | ||
var attempt = function () { main.parse(css, 1); }; | ||
it('accepts a number of context lines to display on error', function() { | ||
var css = ['/* # SUMMARY ---------- */', '.foo { -prop: value; }'].join( | ||
'\n' | ||
); | ||
var attempt = function() { | ||
main.parse(css, 1); | ||
}; | ||
expect(attempt).to.throw([ | ||
'Line 2, column 1: Unexpected rule type "rule"; looking for end summary.', | ||
'-- Context --', | ||
'.foo { -prop: value; }', | ||
'^' | ||
].join('\n')); | ||
expect(attempt).to.throw( | ||
[ | ||
'Line 2, column 1: Unexpected rule type "rule"; looking for end summary.', | ||
'-- Context --', | ||
'.foo { -prop: value; }', | ||
'^', | ||
].join('\n') | ||
); | ||
}); | ||
it('handles a blank comment before module header', function () { | ||
var css = [ | ||
'/* */', | ||
'/* # Module: M */' | ||
].join('\n'); | ||
it('handles a blank comment before module header', function() { | ||
var css = ['/* */', '/* # Module: M */'].join('\n'); | ||
expect(main.parse(css)).to.deep.equal([{ | ||
module: "M", | ||
tests: [] | ||
}]); | ||
expect(main.parse(css)).to.deep.equal([ | ||
{ | ||
module: 'M', | ||
tests: [], | ||
}, | ||
]); | ||
}); | ||
it('ignores unexpected rule type instead of test', function () { | ||
var css = [ | ||
'/* # Module: M */', | ||
'.foo { -prop: value; }', | ||
].join('\n'); | ||
it('ignores unexpected rule type instead of test', function() { | ||
var css = ['/* # Module: M */', '.foo { -prop: value; }'].join('\n'); | ||
expect(main.parse(css)).to.deep.equal([{ | ||
module: "M", | ||
tests: [] | ||
}]); | ||
expect(main.parse(css)).to.deep.equal([ | ||
{ | ||
module: 'M', | ||
tests: [], | ||
}, | ||
]); | ||
}); | ||
it('handles a blank comment before test header', function () { | ||
var css = [ | ||
'/* # Module: M */', | ||
'/* */', | ||
'/* Test: T */', | ||
].join('\n'); | ||
it('handles a blank comment before test header', function() { | ||
var css = ['/* # Module: M */', '/* */', '/* Test: T */'].join('\n'); | ||
expect(main.parse(css)).to.deep.equal([{ | ||
module: "M", | ||
tests: [{ | ||
test: "T", | ||
assertions: [] | ||
}] | ||
}]); | ||
expect(main.parse(css)).to.deep.equal([ | ||
{ | ||
module: 'M', | ||
tests: [ | ||
{ | ||
test: 'T', | ||
assertions: [], | ||
}, | ||
], | ||
}, | ||
]); | ||
}); | ||
it('ignores unexpected rule type instead of assertion', function () { | ||
it('ignores unexpected rule type instead of assertion', function() { | ||
var css = [ | ||
@@ -522,14 +636,20 @@ '/* # Module: M */', | ||
].join('\n'); | ||
var attempt = function () { main.parse(css); }; | ||
var attempt = function() { | ||
main.parse(css); | ||
}; | ||
expect(main.parse(css)).to.deep.equal([{ | ||
module: "M", | ||
tests: [{ | ||
test: "T", | ||
assertions: [] | ||
}] | ||
}]); | ||
expect(main.parse(css)).to.deep.equal([ | ||
{ | ||
module: 'M', | ||
tests: [ | ||
{ | ||
test: 'T', | ||
assertions: [], | ||
}, | ||
], | ||
}, | ||
]); | ||
}); | ||
it('handles a blank comment before assertion', function () { | ||
it('handles a blank comment before assertion', function() { | ||
var css = [ | ||
@@ -539,18 +659,24 @@ '/* # Module: M */', | ||
'/* */', | ||
'/* ✔ Does the thing right */' | ||
'/* ✔ Does the thing right */', | ||
].join('\n'); | ||
expect(main.parse(css)).to.deep.equal([{ | ||
module: "M", | ||
tests: [{ | ||
test: "T", | ||
assertions: [{ | ||
description: "Does the thing right", | ||
passed: true | ||
}] | ||
}] | ||
}]); | ||
expect(main.parse(css)).to.deep.equal([ | ||
{ | ||
module: 'M', | ||
tests: [ | ||
{ | ||
test: 'T', | ||
assertions: [ | ||
{ | ||
description: 'Does the thing right', | ||
passed: true, | ||
}, | ||
], | ||
}, | ||
], | ||
}, | ||
]); | ||
}); | ||
it('allows unexpected comment before next module header', function () { | ||
it('allows unexpected comment before next module header', function() { | ||
var css = [ | ||
@@ -565,20 +691,24 @@ '/* # Module: M */', | ||
{ | ||
module: "M", | ||
tests: [{ | ||
test: "T", | ||
assertions: [{ | ||
assertionType: "assert-true", | ||
description: "True should assert true.", | ||
passed: false, | ||
}] | ||
}], | ||
module: 'M', | ||
tests: [ | ||
{ | ||
test: 'T', | ||
assertions: [ | ||
{ | ||
assertionType: 'assert-true', | ||
description: 'True should assert true.', | ||
passed: false, | ||
}, | ||
], | ||
}, | ||
], | ||
}, | ||
{ | ||
module: "M2", | ||
module: 'M2', | ||
tests: [], | ||
} | ||
}, | ||
]); | ||
}); | ||
it('throws error on unexpected rule type instead of failure detail', function () { | ||
it('throws error on unexpected rule type instead of failure detail', function() { | ||
var css = [ | ||
@@ -590,9 +720,12 @@ '/* # Module: M */', | ||
].join('\n'); | ||
var attempt = function () { main.parse(css); }; | ||
var attempt = function() { | ||
main.parse(css); | ||
}; | ||
expect(attempt).to.throw( | ||
'Line 4, column 1: Unexpected rule type "rule"; looking for output/expected'); | ||
'Line 4, column 1: Unexpected rule type "rule"; looking for output/expected' | ||
); | ||
}); | ||
it('throws error on unexpected rule type instead of OUTPUT', function () { | ||
it('throws error on unexpected rule type instead of OUTPUT', function() { | ||
var css = [ | ||
@@ -604,9 +737,12 @@ '/* # Module: M */', | ||
].join('\n'); | ||
var attempt = function () { main.parse(css); }; | ||
var attempt = function() { | ||
main.parse(css); | ||
}; | ||
expect(attempt).to.throw( | ||
'Line 4, column 1: Unexpected rule type "rule"; looking for OUTPUT'); | ||
'Line 4, column 1: Unexpected rule type "rule"; looking for OUTPUT' | ||
); | ||
}); | ||
it('throws error on unexpected comment instead of OUTPUT', function () { | ||
it('throws error on unexpected comment instead of OUTPUT', function() { | ||
var css = [ | ||
@@ -618,9 +754,12 @@ '/* # Module: M */', | ||
].join('\n'); | ||
var attempt = function () { main.parse(css); }; | ||
var attempt = function() { | ||
main.parse(css); | ||
}; | ||
expect(attempt).to.throw( | ||
'Line 4, column 1: Unexpected comment "foo"; looking for OUTPUT'); | ||
'Line 4, column 1: Unexpected comment "foo"; looking for OUTPUT' | ||
); | ||
}); | ||
it('throws error on unexpected rule type instead of EXPECTED', function () { | ||
it('throws error on unexpected rule type instead of EXPECTED', function() { | ||
var css = [ | ||
@@ -637,9 +776,12 @@ '/* # Module: M */', | ||
].join('\n'); | ||
var attempt = function () { main.parse(css); }; | ||
var attempt = function() { | ||
main.parse(css); | ||
}; | ||
expect(attempt).to.throw( | ||
'Line 9, column 1: Unexpected rule type "rule"; looking for EXPECTED'); | ||
'Line 9, column 1: Unexpected rule type "rule"; looking for EXPECTED' | ||
); | ||
}); | ||
it('throws error on unexpected comment instead of EXPECTED', function () { | ||
it('throws error on unexpected comment instead of EXPECTED', function() { | ||
var css = [ | ||
@@ -656,9 +798,12 @@ '/* # Module: M */', | ||
].join('\n'); | ||
var attempt = function () { main.parse(css); }; | ||
var attempt = function() { | ||
main.parse(css); | ||
}; | ||
expect(attempt).to.throw( | ||
'Line 9, column 1: Unexpected comment "foo"; looking for EXPECTED'); | ||
'Line 9, column 1: Unexpected comment "foo"; looking for EXPECTED' | ||
); | ||
}); | ||
it('throws error on unexpected rule type instead of END_ASSERT', function () { | ||
it('throws error on unexpected rule type instead of END_ASSERT', function() { | ||
var css = [ | ||
@@ -680,9 +825,12 @@ '/* # Module: M */', | ||
].join('\n'); | ||
var attempt = function () { main.parse(css); }; | ||
var attempt = function() { | ||
main.parse(css); | ||
}; | ||
expect(attempt).to.throw( | ||
'Line 14, column 1: Unexpected rule type "rule"; looking for END_ASSERT'); | ||
'Line 14, column 1: Unexpected rule type "rule"; looking for END_ASSERT' | ||
); | ||
}); | ||
it('throws error on unexpected comment instead of END_ASSERT', function () { | ||
it('throws error on unexpected comment instead of END_ASSERT', function() { | ||
var css = [ | ||
@@ -704,10 +852,13 @@ '/* # Module: M */', | ||
].join('\n'); | ||
var attempt = function () { main.parse(css); }; | ||
var attempt = function() { | ||
main.parse(css); | ||
}; | ||
expect(attempt).to.throw( | ||
'Line 14, column 1: Unexpected comment "foo"; looking for END_ASSERT'); | ||
'Line 14, column 1: Unexpected comment "foo"; looking for END_ASSERT' | ||
); | ||
}); | ||
describe('#contains', function () { | ||
it('parses a passing output test', function () { | ||
describe('#contains', function() { | ||
it('parses a passing output test', function() { | ||
var css = [ | ||
@@ -730,17 +881,23 @@ '/* # Module: Contains */', | ||
'/* */', | ||
'/* END_ASSERT */' | ||
'/* END_ASSERT */', | ||
].join('\n'); | ||
var expected = [{ | ||
module: "Contains", | ||
tests: [{ | ||
test: "CSS output contains", | ||
assertions: [{ | ||
description: "Output selector pattern contains input pattern", | ||
assertionType: 'equal', | ||
passed: true, | ||
output: '.test-output {\n height: 10px;\n width: 20px;\n}', | ||
expected: '.test-output {\n height: 10px;\n}' | ||
}], | ||
}], | ||
}]; | ||
var expected = [ | ||
{ | ||
module: 'Contains', | ||
tests: [ | ||
{ | ||
test: 'CSS output contains', | ||
assertions: [ | ||
{ | ||
description: 'Output selector pattern contains input pattern', | ||
assertionType: 'equal', | ||
passed: true, | ||
output: '.test-output {\n height: 10px;\n width: 20px;\n}', | ||
expected: '.test-output {\n height: 10px;\n}', | ||
}, | ||
], | ||
}, | ||
], | ||
}, | ||
]; | ||
@@ -750,3 +907,3 @@ expect(main.parse(css)).to.deep.equal(expected); | ||
it('parses a passing output test with loud comments', function () { | ||
it('parses a passing output test with loud comments', function() { | ||
var css = [ | ||
@@ -773,17 +930,25 @@ '/* Some random loud comment */', | ||
'/* */', | ||
'/* END_ASSERT */' | ||
'/* END_ASSERT */', | ||
].join('\n'); | ||
var expected = [{ | ||
module: "Contains", | ||
tests: [{ | ||
test: "CSS output contains", | ||
assertions: [{ | ||
description: "Output selector pattern contains input pattern", | ||
assertionType: 'equal', | ||
passed: true, | ||
output: '/* Some loud comment */\n\n.test-output {\n height: 10px;\n width: 20px;\n}', | ||
expected: '/* Some loud comment */\n\n.test-output {\n height: 10px;\n}' | ||
}], | ||
}], | ||
}]; | ||
var expected = [ | ||
{ | ||
module: 'Contains', | ||
tests: [ | ||
{ | ||
test: 'CSS output contains', | ||
assertions: [ | ||
{ | ||
description: 'Output selector pattern contains input pattern', | ||
assertionType: 'equal', | ||
passed: true, | ||
output: | ||
'/* Some loud comment */\n\n.test-output {\n height: 10px;\n width: 20px;\n}', | ||
expected: | ||
'/* Some loud comment */\n\n.test-output {\n height: 10px;\n}', | ||
}, | ||
], | ||
}, | ||
], | ||
}, | ||
]; | ||
@@ -793,3 +958,3 @@ expect(main.parse(css)).to.deep.equal(expected); | ||
it('parses a failing output test', function () { | ||
it('parses a failing output test', function() { | ||
var css = [ | ||
@@ -813,17 +978,23 @@ '/* # Module: Contains */', | ||
'/* */', | ||
'/* END_ASSERT */' | ||
'/* END_ASSERT */', | ||
].join('\n'); | ||
var expected = [{ | ||
module: "Contains", | ||
tests: [{ | ||
test: "CSS output contains", | ||
assertions: [{ | ||
description: "Output selector pattern contains input pattern", | ||
assertionType: 'equal', | ||
passed: false, | ||
output: '.test-output {\n height: 10px;\n width: 20px;\n}', | ||
expected: '.test-output {\n height: 20px;\n}' | ||
}], | ||
}], | ||
}]; | ||
var expected = [ | ||
{ | ||
module: 'Contains', | ||
tests: [ | ||
{ | ||
test: 'CSS output contains', | ||
assertions: [ | ||
{ | ||
description: 'Output selector pattern contains input pattern', | ||
assertionType: 'equal', | ||
passed: false, | ||
output: '.test-output {\n height: 10px;\n width: 20px;\n}', | ||
expected: '.test-output {\n height: 20px;\n}', | ||
}, | ||
], | ||
}, | ||
], | ||
}, | ||
]; | ||
@@ -833,3 +1004,3 @@ expect(main.parse(css)).to.deep.equal(expected); | ||
it('parses a failing output test (wrong selector)', function () { | ||
it('parses a failing output test (wrong selector)', function() { | ||
var css = [ | ||
@@ -853,17 +1024,23 @@ '/* # Module: Contains */', | ||
'/* */', | ||
'/* END_ASSERT */' | ||
'/* END_ASSERT */', | ||
].join('\n'); | ||
var expected = [{ | ||
module: "Contains", | ||
tests: [{ | ||
test: "CSS output contains", | ||
assertions: [{ | ||
description: "Output selector pattern contains input pattern", | ||
assertionType: 'equal', | ||
passed: false, | ||
output: '.test-output {\n height: 10px;\n width: 20px;\n}', | ||
expected: '.other-class {\n height: 20px;\n}' | ||
}], | ||
}], | ||
}]; | ||
var expected = [ | ||
{ | ||
module: 'Contains', | ||
tests: [ | ||
{ | ||
test: 'CSS output contains', | ||
assertions: [ | ||
{ | ||
description: 'Output selector pattern contains input pattern', | ||
assertionType: 'equal', | ||
passed: false, | ||
output: '.test-output {\n height: 10px;\n width: 20px;\n}', | ||
expected: '.other-class {\n height: 20px;\n}', | ||
}, | ||
], | ||
}, | ||
], | ||
}, | ||
]; | ||
@@ -874,2 +1051,1 @@ expect(main.parse(css)).to.deep.equal(expected); | ||
}); | ||
var path = require('path'); | ||
var main = require('../lib/main.js'); | ||
var sassFile = path.join(__dirname, 'scss', 'test.scss'); | ||
main.runSass({file: sassFile}, describe, it); | ||
main.runSass({ file: sassFile }, { describe: describe, it: it }); |
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 too big to display
Sorry, the diff of this file is too big to display
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
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 too big to display
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
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
1184272
5
2684
61
244
+ Addedchalk@^2.4.2
+ Addedchalk@2.4.2(transitive)
+ Addedhas-flag@3.0.0(transitive)
+ Addedsupports-color@5.5.0(transitive)
- Removedcss-selector-parser@^1.1.0
- Removedabbrev@1.1.1(transitive)
- Removedajv@6.12.6(transitive)
- Removedamdefine@1.0.1(transitive)
- Removedansi-regex@2.1.14.1.1(transitive)
- Removedansi-styles@2.2.1(transitive)
- Removedaproba@1.2.0(transitive)
- Removedare-we-there-yet@1.1.7(transitive)
- Removedarray-find-index@1.0.2(transitive)
- Removedasn1@0.2.6(transitive)
- Removedassert-plus@1.0.0(transitive)
- Removedasync-foreach@0.1.3(transitive)
- Removedasynckit@0.4.0(transitive)
- Removedaws-sign2@0.7.0(transitive)
- Removedaws4@1.13.2(transitive)
- Removedbalanced-match@1.0.2(transitive)
- Removedbcrypt-pbkdf@1.0.2(transitive)
- Removedblock-stream@0.0.9(transitive)
- Removedbrace-expansion@1.1.11(transitive)
- Removedcamelcase@2.1.15.3.1(transitive)
- Removedcamelcase-keys@2.1.0(transitive)
- Removedcaseless@0.12.0(transitive)
- Removedchalk@1.1.3(transitive)
- Removedcliui@5.0.0(transitive)
- Removedcode-point-at@1.1.0(transitive)
- Removedcombined-stream@1.0.8(transitive)
- Removedconcat-map@0.0.1(transitive)
- Removedconsole-control-strings@1.1.0(transitive)
- Removedcore-util-is@1.0.21.0.3(transitive)
- Removedcross-spawn@3.0.1(transitive)
- Removedcss-selector-parser@1.4.1(transitive)
- Removedcurrently-unhandled@0.4.1(transitive)
- Removeddashdash@1.14.1(transitive)
- Removeddecamelize@1.2.0(transitive)
- Removeddelayed-stream@1.0.0(transitive)
- Removeddelegates@1.0.0(transitive)
- Removedecc-jsbn@0.1.2(transitive)
- Removedemoji-regex@7.0.3(transitive)
- Removederror-ex@1.3.2(transitive)
- Removedextend@3.0.2(transitive)
- Removedextsprintf@1.3.0(transitive)
- Removedfast-deep-equal@3.1.3(transitive)
- Removedfast-json-stable-stringify@2.1.0(transitive)
- Removedfind-up@1.1.23.0.0(transitive)
- Removedforever-agent@0.6.1(transitive)
- Removedform-data@2.3.3(transitive)
- Removedfs.realpath@1.0.0(transitive)
- Removedfstream@1.0.12(transitive)
- Removedfunction-bind@1.1.2(transitive)
- Removedgauge@2.7.4(transitive)
- Removedgaze@1.1.3(transitive)
- Removedget-caller-file@2.0.5(transitive)
- Removedget-stdin@4.0.1(transitive)
- Removedgetpass@0.1.7(transitive)
- Removedglob@7.1.77.2.3(transitive)
- Removedglobule@1.3.4(transitive)
- Removedgraceful-fs@4.2.11(transitive)
- Removedhar-schema@2.0.0(transitive)
- Removedhar-validator@5.1.5(transitive)
- Removedhas-ansi@2.0.0(transitive)
- Removedhas-unicode@2.0.1(transitive)
- Removedhasown@2.0.2(transitive)
- Removedhosted-git-info@2.8.9(transitive)
- Removedhttp-signature@1.2.0(transitive)
- Removedin-publish@2.0.1(transitive)
- Removedindent-string@2.1.0(transitive)
- Removedinflight@1.0.6(transitive)
- Removedis-arrayish@0.2.1(transitive)
- Removedis-core-module@2.16.1(transitive)
- Removedis-finite@1.1.0(transitive)
- Removedis-fullwidth-code-point@1.0.02.0.0(transitive)
- Removedis-typedarray@1.0.0(transitive)
- Removedis-utf8@0.2.1(transitive)
- Removedisarray@1.0.0(transitive)
- Removedisexe@2.0.0(transitive)
- Removedisstream@0.1.2(transitive)
- Removedjs-base64@2.6.4(transitive)
- Removedjsbn@0.1.1(transitive)
- Removedjson-schema@0.4.0(transitive)
- Removedjson-schema-traverse@0.4.1(transitive)
- Removedjson-stringify-safe@5.0.1(transitive)
- Removedjsprim@1.4.2(transitive)
- Removedload-json-file@1.1.0(transitive)
- Removedlocate-path@3.0.0(transitive)
- Removedlodash@4.17.21(transitive)
- Removedloud-rejection@1.6.0(transitive)
- Removedlru-cache@4.1.5(transitive)
- Removedmap-obj@1.0.1(transitive)
- Removedmeow@3.7.0(transitive)
- Removedmime-db@1.52.0(transitive)
- Removedmime-types@2.1.35(transitive)
- Removedminimatch@3.0.83.1.2(transitive)
- Removedminimist@1.2.8(transitive)
- Removedmkdirp@0.5.6(transitive)
- Removednan@2.22.0(transitive)
- Removednode-gyp@3.8.0(transitive)
- Removednode-sass@4.14.1(transitive)
- Removednopt@3.0.6(transitive)
- Removednormalize-package-data@2.5.0(transitive)
- Removednpmlog@4.1.2(transitive)
- Removednumber-is-nan@1.0.1(transitive)
- Removedoauth-sign@0.9.0(transitive)
- Removedobject-assign@4.1.1(transitive)
- Removedonce@1.4.0(transitive)
- Removedos-homedir@1.0.2(transitive)
- Removedos-tmpdir@1.0.2(transitive)
- Removedosenv@0.1.5(transitive)
- Removedp-limit@2.3.0(transitive)
- Removedp-locate@3.0.0(transitive)
- Removedp-try@2.2.0(transitive)
- Removedparse-json@2.2.0(transitive)
- Removedpath-exists@2.1.03.0.0(transitive)
- Removedpath-is-absolute@1.0.1(transitive)
- Removedpath-parse@1.0.7(transitive)
- Removedpath-type@1.1.0(transitive)
- Removedperformance-now@2.1.0(transitive)
- Removedpify@2.3.0(transitive)
- Removedpinkie@2.0.4(transitive)
- Removedpinkie-promise@2.0.1(transitive)
- Removedprocess-nextick-args@2.0.1(transitive)
- Removedpseudomap@1.0.2(transitive)
- Removedpsl@1.15.0(transitive)
- Removedpunycode@2.3.1(transitive)
- Removedqs@6.5.3(transitive)
- Removedread-pkg@1.1.0(transitive)
- Removedread-pkg-up@1.0.1(transitive)
- Removedreadable-stream@2.3.8(transitive)
- Removedredent@1.0.0(transitive)
- Removedrepeating@2.0.1(transitive)
- Removedrequest@2.88.2(transitive)
- Removedrequire-directory@2.1.1(transitive)
- Removedrequire-main-filename@2.0.0(transitive)
- Removedresolve@1.22.10(transitive)
- Removedrimraf@2.7.1(transitive)
- Removedsafe-buffer@5.1.2(transitive)
- Removedsafer-buffer@2.1.2(transitive)
- Removedsass-graph@2.2.5(transitive)
- Removedscss-tokenizer@0.2.3(transitive)
- Removedsemver@5.3.0(transitive)
- Removedset-blocking@2.0.0(transitive)
- Removedsignal-exit@3.0.7(transitive)
- Removedsource-map@0.4.4(transitive)
- Removedspdx-correct@3.2.0(transitive)
- Removedspdx-exceptions@2.5.0(transitive)
- Removedspdx-expression-parse@3.0.1(transitive)
- Removedspdx-license-ids@3.0.21(transitive)
- Removedsshpk@1.18.0(transitive)
- Removedstdout-stream@1.4.1(transitive)
- Removedstring-width@1.0.23.1.0(transitive)
- Removedstring_decoder@1.1.1(transitive)
- Removedstrip-ansi@3.0.15.2.0(transitive)
- Removedstrip-bom@2.0.0(transitive)
- Removedstrip-indent@1.0.1(transitive)
- Removedsupports-color@2.0.0(transitive)
- Removedsupports-preserve-symlinks-flag@1.0.0(transitive)
- Removedtar@2.2.2(transitive)
- Removedtough-cookie@2.5.0(transitive)
- Removedtrim-newlines@1.0.0(transitive)
- Removedtrue-case-path@1.0.3(transitive)
- Removedtunnel-agent@0.6.0(transitive)
- Removedtweetnacl@0.14.5(transitive)
- Removeduri-js@4.4.1(transitive)
- Removedutil-deprecate@1.0.2(transitive)
- Removeduuid@3.4.0(transitive)
- Removedvalidate-npm-package-license@3.0.4(transitive)
- Removedverror@1.10.0(transitive)
- Removedwhich@1.3.1(transitive)
- Removedwhich-module@2.0.1(transitive)
- Removedwide-align@1.1.5(transitive)
- Removedwrap-ansi@5.1.0(transitive)
- Removedwrappy@1.0.2(transitive)
- Removedy18n@4.0.3(transitive)
- Removedyallist@2.1.2(transitive)
- Removedyargs@13.3.2(transitive)
- Removedyargs-parser@13.1.2(transitive)