UNPKG

bit-bin

Version:

<a href="https://opensource.org/licenses/Apache-2.0"><img alt="apache" src="https://img.shields.io/badge/License-Apache%202.0-blue.svg"></a> <a href="https://github.com/teambit/bit/blob/master/CONTRIBUTING.md"><img alt="prs" src="https://img.shields.io/b

69 lines (57 loc) 1.8 kB
"use strict"; var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefault"); function _assert() { const data = _interopRequireDefault(require("assert")); _assert = function () { return data; }; return data; } function _() { const data = _interopRequireDefault(require("./")); _ = function () { return data; }; return data; } describe('detective-sass', function () { function test(src, deps, opts) { // @ts-ignore _assert().default.deepEqual((0, _().default)(src, opts), deps); } describe('throws', function () { it('does not throw for empty files', function () { _assert().default.doesNotThrow(function () { (0, _().default)(''); }); }); it('throws if the given content is not a string', function () { _assert().default.throws(function () { (0, _().default)(function () {}); }); }); it('throws if called with no arguments', function () { _assert().default.throws(function () { // @ts-ignore (0, _().default)(); }); }); it.skip('throws on broken syntax', function () { _assert().default.throws(function () { (0, _().default)('@'); }); }); }); it('dangles the parsed AST', function () { (0, _().default)('@import _foo'); // @ts-ignore _assert().default.ok(_().default.ast); }); describe('sass', function () { it('returns the dependencies of the given .sass file content', function () { // @ts-ignore AUTO-ADDED-AFTER-MIGRATION-PLEASE-FIX! test('@import _foo', ['_foo']); // @ts-ignore AUTO-ADDED-AFTER-MIGRATION-PLEASE-FIX! test('@import _foo', ['_foo']); // @ts-ignore AUTO-ADDED-AFTER-MIGRATION-PLEASE-FIX! test('@import reset', ['reset']); }); }); });