Skip to content

Commit

Permalink
Remove hardcoded sass-loader version in addPackagesVersionConstraint …
Browse files Browse the repository at this point in the history
…test
  • Loading branch information
Lyrkan committed Oct 10, 2018
1 parent 7abea75 commit 0161000
Showing 1 changed file with 7 additions and 3 deletions.
10 changes: 7 additions & 3 deletions test/package-helper.js
Expand Up @@ -13,6 +13,7 @@ const expect = require('chai').expect;
const packageHelper = require('../lib/package-helper');
const path = require('path');
const process = require('process');
const fs = require('fs');

describe('package-helper', () => {
const baseCwd = process.cwd();
Expand Down Expand Up @@ -135,14 +136,17 @@ describe('package-helper', () => {

describe('addPackagesVersionConstraint', () => {
it('Lookup a version constraint', () => {
// hardcoding sass-loader: test WILL break when this changes

const inputPackages = [
{ name: 'sass-loader', enforce_version: 7 },
{ name: 'node-sass' }
];

const packageInfo = JSON.parse(
fs.readFileSync(path.join(__dirname, '../package.json'))
);

const expectedPackages = [
{ name: 'sass-loader', version: '^7.0.1' },
{ name: 'sass-loader', version: packageInfo.devDependencies['sass-loader'] },
{ name: 'node-sass' }
];

Expand Down

0 comments on commit 0161000

Please sign in to comment.