Skip to content

Commit

Permalink
add test for option.alias
Browse files Browse the repository at this point in the history
  • Loading branch information
Akimyou committed Mar 7, 2018
1 parent b13a009 commit 6de9b00
Showing 1 changed file with 7 additions and 2 deletions.
9 changes: 7 additions & 2 deletions test/options.spec.js
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
'use strict';

var chai = require('chai'),
var path = require('path'),
chai = require('chai'),
pp = require('../lib/preprocess');

chai.should();
Expand Down Expand Up @@ -66,9 +67,13 @@ describe('shall support multiple call signatures', function () {
});

describe('and support alias(dir path) options', function () {
it('and use alias option', function () {
it('and use alias option with relative path', function () {
input = "a<!--@include @static.txt-->c";
pp.preprocess(input, {}, { alias: { '@': 'test/fixtures/include/' } }).should.equal("a!bazqux!c");
});
it('and use alias option with absolute path', function () {
input = "a<!--@include @static.txt-->c";
pp.preprocess(input, {}, { alias: { '@': path.join(__dirname, 'fixtures/include/') } }).should.equal("a!bazqux!c");
});
});
});

0 comments on commit 6de9b00

Please sign in to comment.