本文整理汇总了TypeScript中@angular/cli/utilities/dynamic-path-parser.dynamicPathParser函数的典型用法代码示例。如果您正苦于以下问题:TypeScript dynamicPathParser函数的具体用法?TypeScript dynamicPathParser怎么用?TypeScript dynamicPathParser使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。
在下文中一共展示了dynamicPathParser函数的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的TypeScript代码示例。
示例1: mockFs
() => {
const mockFolder: any = {};
mockFolder[rootName] = {
src: {
app: {
'index.html': '<html></html>',
'child-dir': {
'grand-child-dir': {},
'temp-name': {}
}
}
}
};
mockFs(mockFolder);
process.env.PWD = path.join(project.root, 'src', 'app', 'child-dir', 'grand-child-dir');
const options = {
project,
entityName: '..' + path.sep + entityName,
appConfig,
dryRun: false
};
const result = dynamicPathParser(options);
expect(result.dir).to.equal(`${appDir}${path.sep}child-dir`);
expect(result.name).to.equal(entityName);
});
示例2: it
it(`parse from proj src${path.sep}client${path.sep}app dir`, () => {
process.env.PWD = path.join(project.root, 'src', 'client', 'app');
const options = {
project,
entityName,
appConfig,
dryRun: false
};
const result = dynamicPathParser(options);
expect(result.dir).to.equal(appDir);
expect(result.name).to.equal(entityName);
});
示例3: it
it('parse from proj src dir', () => {
process.env.PWD = path.join(project.root, 'src');
const options = {
project,
entityName,
appConfig,
dryRun: false
};
const result = dynamicPathParser(options);
expect(result.dir).toBe(appDir);
expect(result.name).toBe(entityName);
});