mirror of
https://github.com/angular/angular-cli.git
synced 2025-05-18 11:44:05 +08:00
test(@angular-devkit/schematics): use HostTree instead of VirtualTree
This commit is contained in:
parent
e0720b7f62
commit
af8e7ea333
@ -8,7 +8,7 @@
|
|||||||
// tslint:disable:non-null-operator
|
// tslint:disable:non-null-operator
|
||||||
import { of as observableOf } from 'rxjs';
|
import { of as observableOf } from 'rxjs';
|
||||||
import { SchematicContext } from '../engine/interface';
|
import { SchematicContext } from '../engine/interface';
|
||||||
import { VirtualTree } from '../tree/virtual';
|
import { HostTree } from '../tree/host-tree';
|
||||||
import { callRule } from './call';
|
import { callRule } from './call';
|
||||||
import { move } from './move';
|
import { move } from './move';
|
||||||
|
|
||||||
@ -18,7 +18,7 @@ const context: SchematicContext = null !;
|
|||||||
|
|
||||||
describe('move', () => {
|
describe('move', () => {
|
||||||
it('works on moving the whole structure', done => {
|
it('works on moving the whole structure', done => {
|
||||||
const tree = new VirtualTree();
|
const tree = new HostTree();
|
||||||
tree.create('a/b/file1', 'hello world');
|
tree.create('a/b/file1', 'hello world');
|
||||||
tree.create('a/b/file2', 'hello world');
|
tree.create('a/b/file2', 'hello world');
|
||||||
tree.create('a/c/file3', 'hello world');
|
tree.create('a/c/file3', 'hello world');
|
||||||
@ -34,7 +34,7 @@ describe('move', () => {
|
|||||||
});
|
});
|
||||||
|
|
||||||
it('works on moving a subdirectory structure', done => {
|
it('works on moving a subdirectory structure', done => {
|
||||||
const tree = new VirtualTree();
|
const tree = new HostTree();
|
||||||
tree.create('a/b/file1', 'hello world');
|
tree.create('a/b/file1', 'hello world');
|
||||||
tree.create('a/b/file2', 'hello world');
|
tree.create('a/b/file2', 'hello world');
|
||||||
tree.create('a/c/file3', 'hello world');
|
tree.create('a/c/file3', 'hello world');
|
||||||
|
@ -6,7 +6,7 @@
|
|||||||
* found in the LICENSE file at https://angular.io/license
|
* found in the LICENSE file at https://angular.io/license
|
||||||
*/
|
*/
|
||||||
import { Source } from '../engine/interface';
|
import { Source } from '../engine/interface';
|
||||||
import { VirtualTree } from '../tree/virtual';
|
import { HostTree } from '../tree/host-tree';
|
||||||
|
|
||||||
|
|
||||||
function generateStringOfLength(l: number) {
|
function generateStringOfLength(l: number) {
|
||||||
@ -32,7 +32,7 @@ export default function(options: RandomOptions): Source {
|
|||||||
return () => {
|
return () => {
|
||||||
const root = ('root' in options) ? options.root : '/';
|
const root = ('root' in options) ? options.root : '/';
|
||||||
|
|
||||||
const map = new VirtualTree();
|
const map = new HostTree();
|
||||||
const nbFiles = ('multiFiles' in options)
|
const nbFiles = ('multiFiles' in options)
|
||||||
? (typeof options.multiFiles == 'number' ? options.multiFiles : random(2, 12))
|
? (typeof options.multiFiles == 'number' ? options.multiFiles : random(2, 12))
|
||||||
: 1;
|
: 1;
|
||||||
|
Loading…
x
Reference in New Issue
Block a user