UNPKG

1.25 kBJavaScriptView Raw
1"use strict";
2Object.defineProperty(exports, "__esModule", { value: true });
3var path_1 = require("path");
4var preprocess = require("./preprocess");
5var deeplink = require("./deep-linking");
6var helpers = require("./util/helpers");
7var globUtil = require("./util/glob-util");
8describe('Preprocess Task', function () {
9 describe('preprocess', function () {
10 it('should call deepLink but not write files to disk', function () {
11 // arrange
12 var context = {
13 optimizeJs: false
14 };
15 var mockDirName = path_1.join('some', 'fake', 'dir');
16 var mockGlobResults = [];
17 mockGlobResults.push({ absolutePath: mockDirName });
18 mockGlobResults.push({ absolutePath: mockDirName + '2' });
19 spyOn(deeplink, deeplink.deepLinking.name).and.returnValue(Promise.resolve());
20 spyOn(helpers, helpers.getBooleanPropertyValue.name).and.returnValue(false);
21 spyOn(helpers, helpers.getStringPropertyValue.name).and.returnValue(mockDirName);
22 spyOn(globUtil, globUtil.globAll.name).and.returnValue(Promise.resolve(mockGlobResults));
23 // act
24 return preprocess.preprocess(context);
25 });
26 });
27});