This commit is contained in:
lalBi94
2023-03-05 13:23:23 +01:00
commit 7bc56c09b5
14034 changed files with 1834369 additions and 0 deletions

2035
node_modules/node-sass/test/api.js generated vendored Normal file

File diff suppressed because it is too large Load Diff

129
node_modules/node-sass/test/binding.js generated vendored Normal file
View File

@@ -0,0 +1,129 @@
/*eslint new-cap: ["error", {"capIsNewExceptions": ["Color"]}]*/
var assert = require('assert').strict,
path = require('path'),
etx = require('../lib/extensions'),
binding = process.env.NODESASS_COV
? require('../lib-cov/binding')
: require('../lib/binding');
describe('binding', function() {
describe('missing error', function() {
it('should be useful', function() {
process.env.SASS_BINARY_NAME = 'unknown-x64-48';
assert.throws(
function() { binding(etx); },
function(err) {
var re = new RegExp('Missing binding.*?\\' + path.sep + 'vendor\\' + path.sep);
if ((err instanceof Error)) {
return re.test(err);
}
}
);
});
it('should list currently installed bindings', function() {
assert.throws(
function() { binding(etx); },
function(err) {
var etx = require('../lib/extensions');
delete process.env.SASS_BINARY_NAME;
if ((err instanceof Error)) {
return err.message.indexOf(
etx.getHumanEnvironment(etx.getBinaryName())
) !== -1;
}
}
);
});
});
describe('on unsupported environment', function() {
describe('with an unsupported architecture', function() {
beforeEach(function() {
Object.defineProperty(process, 'arch', {
value: 'foo',
});
});
afterEach(function() {
Object.defineProperty(process, 'arch', {
value: 'x64',
});
});
it('should error', function() {
assert.throws(
function() { binding(etx); },
'Node Sass does not yet support your current environment'
);
});
it('should inform the user the architecture is unsupported', function() {
assert.throws(
function() { binding(etx); },
'Unsupported architecture (foo)'
);
});
});
describe('with an unsupported platform', function() {
beforeEach(function() {
Object.defineProperty(process, 'platform', {
value: 'bar',
});
});
afterEach(function() {
Object.defineProperty(process, 'platform', {
value: 'darwin',
});
});
it('should error', function() {
assert.throws(
function() { binding(etx); },
'Node Sass does not yet support your current environment'
);
});
it('should inform the user the platform is unsupported', function() {
assert.throws(
function() { binding(etx); },
'Unsupported platform (bar)'
);
});
});
describe('with an unsupported runtime', function() {
beforeEach(function() {
Object.defineProperty(process.versions, 'modules', {
value: 'baz',
});
});
afterEach(function() {
Object.defineProperty(process.versions, 'modules', {
value: 51,
});
});
it('should error', function() {
assert.throws(
function() { binding(etx); },
'Node Sass does not yet support your current environment'
);
});
it('should inform the user the runtime is unsupported', function() {
assert.throws(
function() { binding(etx); },
'Unsupported runtime (baz)'
);
});
});
});
});

793
node_modules/node-sass/test/cli.js generated vendored Normal file

File diff suppressed because it is too large Load Diff

129
node_modules/node-sass/test/downloadoptions.js generated vendored Normal file
View File

@@ -0,0 +1,129 @@
var assert = require('assert').strict,
ua = require('../scripts/util/useragent'),
opts = require('../scripts/util/downloadoptions');
describe('util', function() {
describe('downloadoptions', function() {
describe('without a proxy', function() {
it('should look as we expect', function() {
var expected = {
strictSSL: true,
timeout: 60000,
headers: {
'User-Agent': ua(),
},
};
assert.deepStrictEqual(opts(), expected);
});
});
describe('with an npm config proxy', function() {
var proxy = 'http://test.proxy:1234';
before(function() {
process.env.npm_config_proxy = proxy;
});
after(function() {
delete process.env.npm_config_proxy;
});
it('should look as we expect', function() {
var expected = {
strictSSL: true,
proxy: proxy,
timeout: 60000,
headers: {
'User-Agent': ua(),
},
};
assert.deepStrictEqual(opts(), expected);
});
});
describe('with an env proxy proxy', function() {
var proxy = 'http://test.proxy:1234';
before(function() {
process.env.HTTP_PROXY = proxy;
});
after(function() {
delete process.env.HTTP_PROXY;
});
it('should look as we expect', function() {
var expected = {
strictSSL: true,
timeout: 60000,
headers: {
'User-Agent': ua(),
},
};
assert.deepStrictEqual(opts(), expected);
});
});
describe('with SASS_REJECT_UNAUTHORIZED set to false', function() {
beforeEach(function() {
process.env.SASS_REJECT_UNAUTHORIZED = '0';
});
it('should look as we expect', function() {
var expected = {
strictSSL: false,
timeout: 60000,
headers: {
'User-Agent': ua(),
},
};
assert.deepStrictEqual(opts(), expected);
});
});
describe('with SASS_REJECT_UNAUTHORIZED set to true', function() {
beforeEach(function() {
process.env.SASS_REJECT_UNAUTHORIZED = '1';
});
it('should look as we expect', function() {
var expected = {
strictSSL: true,
timeout: 60000,
headers: {
'User-Agent': ua(),
},
};
assert.deepStrictEqual(opts(), expected);
});
});
describe('with npm_config_sass_reject_unauthorized set to true', function() {
beforeEach(function() {
process.env.npm_config_sass_reject_unauthorized = true;
});
it('should look as we expect', function() {
var expected = {
strictSSL: true,
timeout: 60000,
headers: {
'User-Agent': ua(),
},
};
assert.deepStrictEqual(opts(), expected);
});
afterEach(function() {
process.env.npm_config_sass_reject_unauthorized = undefined;
});
});
});
});

53
node_modules/node-sass/test/errors.js generated vendored Normal file
View File

@@ -0,0 +1,53 @@
var assert = require('assert').strict,
path = require('path'),
errors = require('../lib/errors');
describe('binary errors', function() {
function getCurrentPlatform() {
if (process.platform === 'win32') {
return 'Windows';
} else if (process.platform === 'darwin') {
return 'OS X';
}
return '';
}
function getCurrentArchitecture() {
if (process.arch === 'x86' || process.arch === 'ia32') {
return '32-bit';
} else if (process.arch === 'x64') {
return '64-bit';
}
return '';
}
function getCurrentEnvironment() {
return getCurrentPlatform() + ' ' + getCurrentArchitecture();
}
describe('for an unsupported environment', function() {
it('identifies the current environment', function() {
var message = errors.unsupportedEnvironment();
assert.ok(message.indexOf(getCurrentEnvironment()) !== -1);
});
it('links to supported environment documentation', function() {
var message = errors.unsupportedEnvironment();
assert.ok(message.indexOf('https://github.com/sass/node-sass/releases/tag/v') !== -1);
});
});
describe('for an missing binary', function() {
it('identifies the current environment', function() {
var message = errors.missingBinary();
assert.ok(message.indexOf(getCurrentEnvironment()) !== -1);
});
it('documents the expected binary location', function() {
var message = errors.missingBinary();
assert.ok(message.indexOf(path.sep + 'vendor' + path.sep) !== -1);
});
});
});

View File

@@ -0,0 +1 @@
#navbar{width:80%;height:23px}#navbar ul{list-style-type:none}#navbar li{float:left}#navbar li a{font-weight:bold}

View File

@@ -0,0 +1,16 @@
#navbar {
width: 80%;
height: 23px;
}
#navbar ul {
list-style-type: none;
}
#navbar li {
float: left;
a {
font-weight: bold;
}
}

View File

@@ -0,0 +1,3 @@
div {
width: 42rem;
height: 84px; }

View File

@@ -0,0 +1 @@
div { width: foo(42px); height: bar(42px); }

View File

@@ -0,0 +1,2 @@
div {
color: "barbar"; }

View File

@@ -0,0 +1 @@
div { color: foo("bar"); }

View File

@@ -0,0 +1,2 @@
.outside {
color: red; }

View File

@@ -0,0 +1,3 @@
.outside {
color: red;
}

View File

@@ -0,0 +1 @@
@import 'outside';

View File

@@ -0,0 +1,6 @@
@import "vars";
@import "struct";
.myvars {
content: quote($import_counter);
}

View File

@@ -0,0 +1,3 @@
.common-struct {
content: "common-struct";
}

View File

@@ -0,0 +1,5 @@
$import_counter: $import_counter + 1;
.common-vars {
content: "common-vars";
}

View File

@@ -0,0 +1,7 @@
@import "_common";
@import "a1";
.a2 {
content: "a2";
}

View File

@@ -0,0 +1,3 @@
.a1 {
content: "a1";
}

View File

@@ -0,0 +1,5 @@
@import "b1";
.b2 {
content: "b2";
}

View File

@@ -0,0 +1,3 @@
.b1 {
content: "b1";
}

View File

@@ -0,0 +1,32 @@
.common-vars {
content: "common-vars"; }
.common-struct {
content: "common-struct"; }
.myvars {
content: "1"; }
.a1 {
content: "a1"; }
.a2 {
content: "a2"; }
.common-vars {
content: "common-vars"; }
.common-struct {
content: "common-struct"; }
.myvars {
content: "2"; }
.b1 {
content: "b1"; }
.b2 {
content: "b2"; }
#the-last {
content: "LAST"; }

View File

@@ -0,0 +1,8 @@
$import_counter: 0;
@import "a";
@import "common";
@import "b";
#the-last {
content: "LAST";
}

View File

@@ -0,0 +1,12 @@
var sass = require('../../..');
module.exports = [
function() {
return sass.NULL;
},
function() {
return {
contents: 'div {color: yellow;}'
};
}
];

View File

@@ -0,0 +1,10 @@
module.exports = {
'foo($a)': function(size) {
size.setUnit('rem');
return size;
},
'bar($a)': function(size) {
size.setValue(size.getValue() * 2);
return size;
}
};

View File

@@ -0,0 +1,8 @@
var sass = require('../../..');
module.exports = {
'foo($a)': function(str) {
str = str.getValue().replace(/['"]/g, '');
return new sass.types.String('"' + str + str + '"');
}
};

View File

@@ -0,0 +1,5 @@
module.exports = function() {
return {
contents: 'div {color: yellow;}'
};
};

View File

@@ -0,0 +1,5 @@
module.exports = function(file, prev, done) {
done({
contents: 'div {color: yellow;}'
});
};

View File

@@ -0,0 +1,3 @@
module.exports = function() {
return new Error('doesn\'t exist!');
};

View File

@@ -0,0 +1,7 @@
var path = require('path');
module.exports = function(file) {
return {
file: path.resolve(path.join(process.cwd(), 'test/fixtures/include-files/', file + (path.extname(file) ? '' : '.scss')))
};
};

View File

@@ -0,0 +1,6 @@
module.exports = function() {
return {
file: '/some/random/path/file.scss',
contents: 'div {color: yellow;}'
};
};

View File

@@ -0,0 +1,6 @@
module.exports = function(file, prev, done) {
done({
file: '/some/random/path/file.scss',
contents: 'div {color: yellow;}'
});
};

View File

@@ -0,0 +1,7 @@
var path = require('path');
module.exports = function(file, /* jshint unused:false */ prev, done) {
done({
file: path.resolve(path.join(process.cwd(), 'test/fixtures/include-files/', file + (path.extname(file) ? '' : '.scss')))
});
};

View File

@@ -0,0 +1,16 @@
#navbar {
width: 80%;
height: 23px;
}
#navbar ul {
list-style-type: none;
}
#navbar li {
float: left;
a {
font-weight: bold;
}
}

View File

@@ -0,0 +1 @@
/* bar.scss */

View File

@@ -0,0 +1 @@
@import "file-not-processed-by-loader", "file-processed-by-loader";

View File

@@ -0,0 +1,5 @@
div {
color: yellow; }
div {
color: yellow; }

View File

@@ -0,0 +1,2 @@
/* foo.scss */
/* bar.scss */

View File

@@ -0,0 +1,5 @@
div {
color: yellow; }
div {
color: yellow; }

View File

@@ -0,0 +1 @@
$variable-defined-by-file-not-processed-by-loader: 'red';

View File

@@ -0,0 +1,3 @@
body {
color: $variable-defined-by-file-not-processed-by-loader;
}

View File

@@ -0,0 +1 @@
/* foo.scss */

View File

@@ -0,0 +1,2 @@
@import 'foo';
@import 'bar';

View File

@@ -0,0 +1,3 @@
body {
background: red;
color: #0000fe; }

View File

@@ -0,0 +1,3 @@
@function colorBlue() {
@return #0000fe;
}

View File

@@ -0,0 +1,7 @@
@import 'vars';
@import 'colorBlue';
body {
background: $color;
color: colorBlue();
}

View File

@@ -0,0 +1 @@
$color: red;

View File

@@ -0,0 +1,2 @@
foo + bar {
color: red; }

View File

@@ -0,0 +1,3 @@
foo
+ bar
color: red

View File

@@ -0,0 +1,16 @@
#navbar {
width: 80%;
height: 23px;
}
#navbar ul {
list-style-type: none;
}
#navbar li {
float: left;
a {
font-weight: bold;
}
}

Some files were not shown because too many files have changed in this diff Show More