本文整理汇总了TypeScript中shelljs.ls函数的典型用法代码示例。如果您正苦于以下问题:TypeScript ls函数的具体用法?TypeScript ls怎么用?TypeScript ls使用的例子?那么, 这里精选的函数代码示例或许可以为您提供帮助。
在下文中一共展示了ls函数的6个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的TypeScript代码示例。
示例1: it
it('should have right fesm files', () => {
const expected = [
'example.js',
'example.js.map',
'secondary.js',
'secondary.js.map',
];
expect(shx.ls('-R', 'esm5').stdout.split('\n').filter(n => !!n).sort()).toEqual(expected);
expect(shx.ls('-R', 'esm2015').stdout.split('\n').filter(n => !!n).sort()).toEqual(expected);
});
示例2: it
it('should have right fesm files', () => {
const expected = [
'common.js',
'common.js.map',
'http',
'http.js',
'http.js.map',
'http/testing.js',
'http/testing.js.map',
'testing.js',
'testing.js.map',
];
expect(shx.ls('-R', 'fesm5').stdout.split('\n').filter(n => !!n).sort()).toEqual(expected);
expect(shx.ls('-R', 'fesm2015').stdout.split('\n').filter(n => !!n).sort()).toEqual(expected);
});
示例3: function
let writeFile = function (filename, dir, match: string[], prefix = '$') {
let res = shell.ls(dir);
for (let str of match) {
fs.writeFileSync(path.join(dir, `${str}_${filename}`), refFiles(res, str, prefix));
}
}
示例4: it
it('should generate valid samples .js that keeps the jsdoc top comment', () => {
ls('spec/assets/*Sample.ts').forEach((file) => {
let js = cat(file.replace('.ts', '.js'))
expect(js).toContain(' * @NApiVersion 2')
try {
parseScript(js)
} catch (ex) {
fail('invalid javascript generated')
console.log(ex, ex.stack)
}
})
})
示例5: expect
() => { expect(shx.ls('bundles/core-testing.umd.js').length).toBe(1, 'File not found'); });
示例6: then
then(() => shell.ls('-l', inputDir) as any as Promise<(fs.Stats & {name: string})[]>).