Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Combine Folders Feature Added #115

Closed
wants to merge 8 commits into from
Closed
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Next Next commit
test example update
danny007in committed Jan 23, 2021
commit 15d27445ceb75906b83e7adc9bc3da70416011d5
28 changes: 26 additions & 2 deletions tests/integration.js
Original file line number Diff line number Diff line change
@@ -9,14 +9,15 @@ const expectedUnused = [
'$black',
'$nestedVar',
'$nestNestedVar',
'$enabled-variable'
'$enabled-variable',
'$other-folder-variable'
];

const ignore = ['$ignored-variable'];

console.log('Running integration tests...');

const result = fusv.find('./', { ignore });
const result = fusv.find('./tests/main', { ignore });

if (result.unused.length === expectedUnused.length) {
console.info('Tests passed!');
@@ -25,3 +26,26 @@ if (result.unused.length === expectedUnused.length) {
Expected: ${expectedUnused.join(', ')}
Got: ${result.unused.join(', ')}`);
}

// Result for Combine

const expectedUnusedForCombine = [
'$a',
'$b',
'$unused',
'$black',
'$nestedVar',
'$nestNestedVar',
'$enabled-variable'
];

// For combine with other folder './tests/other' also can with node_modules ect..
const resultOfCombine = fusv.find(['./tests/main', './tests/other'], { ignore, combine: true });

if (resultOfCombine.unused.length === expectedUnusedForCombine.length) {
console.info('Combine Folders Tests passed!');
} else {
throw new Error(`Expected ${expectedUnusedForCombine.length} and got ${result.unused.length}
Expected: ${expectedUnusedForCombine.join(', ')}
Got: ${result.unused.join(', ')} For Combine Folder Tests`);
}
3 changes: 3 additions & 0 deletions tests/_variables.scss → tests/main/_variables.scss
Original file line number Diff line number Diff line change
@@ -17,3 +17,6 @@ $disabled-variable: #bada55;
// fusv-enable

$enabled-variable: #b000b5;

// Other Folder
$other-folder-variable: red;
File renamed without changes.
3 changes: 3 additions & 0 deletions tests/other/other_test.scss
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
body {
background-color: $other-folder-variable;
}