1 /*eslint new-cap: ["error", {"capIsNewExceptions": ["Color"]}]*/
3 var assert = require('assert'),
4 path = require('path'),
5 etx = require('../lib/extensions'),
6 binding = process.env.NODESASS_COV
7 ? require('../lib-cov/binding')
8 : require('../lib/binding');
10 describe('binding', function() {
11 describe('missing error', function() {
12 it('should be useful', function() {
13 process.env.SASS_BINARY_NAME = 'Linux-x64-48';
15 function() { binding(etx); },
17 var re = new RegExp('Missing binding.*?\\' + path.sep + 'vendor\\' + path.sep);
18 if ((err instanceof Error)) {
25 it('should list currently installed bindings', function() {
27 function() { binding(etx); },
29 var etx = require('../lib/extensions');
31 delete process.env.SASS_BINARY_NAME;
33 if ((err instanceof Error)) {
34 return err.message.indexOf(
35 etx.getHumanEnvironment(etx.getBinaryName())
43 describe('on unsupported environment', function() {
44 describe('with an unsupported architecture', function() {
47 beforeEach(function() {
48 prevValue = process.arch;
50 Object.defineProperty(process, 'arch', {
55 afterEach(function() {
56 Object.defineProperty(process, 'arch', {
61 it('should error', function() {
63 function() { binding(etx); },
64 'Node Sass does not yet support your current environment'
68 it('should inform the user the architecture is unsupported', function() {
70 function() { binding(etx); },
71 'Unsupported architecture (foo)'
76 describe('with an unsupported platform', function() {
79 beforeEach(function() {
80 prevValue = process.platform;
82 Object.defineProperty(process, 'platform', {
87 afterEach(function() {
88 Object.defineProperty(process, 'platform', {
93 it('should error', function() {
95 function() { binding(etx); },
96 'Node Sass does not yet support your current environment'
100 it('should inform the user the platform is unsupported', function() {
102 function() { binding(etx); },
103 'Unsupported platform (bar)'
108 describe('with an unsupported runtime', function() {
111 beforeEach(function() {
112 prevValue = process.versions.modules;
114 Object.defineProperty(process.versions, 'modules', {
119 afterEach(function() {
120 Object.defineProperty(process.versions, 'modules', {
125 it('should error', function() {
127 function() { binding(etx); },
128 'Node Sass does not yet support your current environment'
132 it('should inform the user the runtime is unsupported', function() {
134 function() { binding(etx); },
135 'Unsupported runtime (baz)'