Skip to content

Commit

Permalink
Add a test which is using namespaced packages
Browse files Browse the repository at this point in the history
See #163
  • Loading branch information
maoberlehner committed Mar 6, 2018
1 parent 2ac0fb5 commit dfc0955
Show file tree
Hide file tree
Showing 8 changed files with 32 additions and 2 deletions.

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

9 changes: 9 additions & 0 deletions test/files/package-import.css
Original file line number Diff line number Diff line change
Expand Up @@ -6,3 +6,12 @@

.test-package-css {
content: 'css index file'; }

.namespace-test-package-main {
content: 'namespace main scss file'; }

.namespace-test-package-main {
content: 'namespace main css file'; }

.namespace-test-package-css {
content: 'namespace css index file'; }
4 changes: 4 additions & 0 deletions test/files/package-import.scss
Original file line number Diff line number Diff line change
@@ -1,3 +1,7 @@
@import '~test-package-main';
@import '~test-package-main/css/main';
@import '~test-package-css';

@import '~@namespace/test-package-main';
@import '~@namespace/test-package-main/css/main';
@import '~@namespace/test-package-css';
4 changes: 2 additions & 2 deletions test/package-importer.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ import { exec } from 'child_process';
import * as packageImporter from '../packages/node-sass-package-importer/dist/index';

describe(`packageImporter()`, () => {
test(`It should import the modules main file.`, () => {
test(`It should import files from modules.`, () => {
const expectedResult = fs.readFileSync(`test/files/package-import.css`, {
encoding: `utf8`,
});
Expand All @@ -20,7 +20,7 @@ describe(`packageImporter()`, () => {
expect(result).toBe(expectedResult);
});

test(`It should import the modules main file via CLI.`, async () => {
test(`It should import files from modules via CLI.`, async () => {
// tslint:disable-next-line max-line-length
const cmd = `cd ${__dirname}/files && node ../../node_modules/.bin/node-sass --importer ../../packages/node-sass-package-importer/dist/cli.js package-import.scss`;
const expectedResult = fs.readFileSync(`test/files/package-import.css`, {
Expand Down

0 comments on commit dfc0955

Please sign in to comment.