chore(windows): fix the test.unit.tools task

This commit is contained in:
Marc Laval 2015-06-23 18:09:32 +02:00
parent ecb2bd0cbe
commit 746efe7eba
2 changed files with 14 additions and 6 deletions

View File

@ -3,6 +3,7 @@
let mockfs = require('mock-fs');
import fs = require('fs');
import path = require('path');
import {TreeDiffer} from './tree-differ';
import {DiffingFlatten} from './broccoli-flatten';
@ -69,6 +70,7 @@ describe('Flatten', () => {
let differ = new TreeDiffer('testLabel', 'input');
let flattenedTree = flatten('input');
expect(() => flattenedTree.rebuild(differ.diffTree()))
.toThrowError("Duplicate file 'file-1.txt' found in path 'dir1/subdir-1/file-1.txt'");
.toThrowError("Duplicate file 'file-1.txt' found in path 'dir1" + path.sep + "subdir-1" +
path.sep + "file-1.txt'");
});
});

View File

@ -3,6 +3,7 @@
let mockfs = require('mock-fs');
import fs = require('fs');
import path = require('path');
import {TreeDiffer} from './tree-differ';
@ -30,7 +31,8 @@ describe('TreeDiffer', () => {
let diffResult = differ.diffTree();
expect(diffResult.addedPaths).toEqual(['file-1.txt', 'file-2.txt', 'subdir-1/file-1.1.txt']);
expect(diffResult.addedPaths)
.toEqual(['file-1.txt', 'file-2.txt', 'subdir-1' + path.sep + 'file-1.1.txt']);
expect(diffResult.changedPaths).toEqual([]);
expect(diffResult.removedPaths).toEqual([]);
@ -82,7 +84,8 @@ describe('TreeDiffer', () => {
let diffResult = differ.diffTree();
expect(diffResult.addedPaths).toEqual(['file-1.txt', 'file-2.txt', 'subdir-1/file-1.1.txt']);
expect(diffResult.addedPaths)
.toEqual(['file-1.txt', 'file-2.txt', 'subdir-1' + path.sep + 'file-1.1.txt']);
// change two files
testDir['dir1']['file-1.txt'] = mockfs.file({content: 'new content', mtime: new Date(1000)});
@ -92,7 +95,8 @@ describe('TreeDiffer', () => {
diffResult = differ.diffTree();
expect(diffResult.changedPaths).toEqual(['file-1.txt', 'subdir-1/file-1.1.txt']);
expect(diffResult.changedPaths)
.toEqual(['file-1.txt', 'subdir-1' + path.sep + 'file-1.1.txt']);
expect(diffResult.removedPaths).toEqual([]);
@ -127,7 +131,8 @@ describe('TreeDiffer', () => {
let diffResult = differ.diffTree();
expect(diffResult.addedPaths).toEqual(['file-1.txt', 'file-2.txt', 'subdir-1/file-1.1.txt']);
expect(diffResult.addedPaths)
.toEqual(['file-1.txt', 'file-2.txt', 'subdir-1' + path.sep + 'file-1.1.txt']);
// change two files
testDir['orig_path']['file-1.txt'] =
@ -139,7 +144,8 @@ describe('TreeDiffer', () => {
diffResult = differ.diffTree();
expect(diffResult.addedPaths).toEqual([]);
expect(diffResult.changedPaths).toEqual(['file-1.txt', 'subdir-1/file-1.1.txt']);
expect(diffResult.changedPaths)
.toEqual(['file-1.txt', 'subdir-1' + path.sep + 'file-1.1.txt']);
expect(diffResult.removedPaths).toEqual([]);
// change one file