本文整理汇总了TypeScript中path.join函数的典型用法代码示例。如果您正苦于以下问题:TypeScript join函数的具体用法?TypeScript join怎么用?TypeScript join使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。
在下文中一共展示了join函数的10个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的TypeScript代码示例。
示例1: config
private config() {
this.app.set('views', path.join(__dirname, 'views'));
this.app.set('view engine', 'hbs');
}
示例2: remove
projectDirCreated: projectDir => remove(path.join(projectDir, "build")),
示例3: expect
packed: async context => {
expect(platformPackager.effectiveDistOptions.background).toEqual(customBackground)
expect(platformPackager.effectiveDistOptions.icon).toEqual("foo.icns")
expect(await platformPackager.getIconPath()).toEqual(path.join(context.projectDir, "customIcon.icns"))
},
示例4: suite
suite('Node Debug Adapter', () => {
const DEBUG_ADAPTER = './out/mockDebug.js';
const PROJECT_ROOT = Path.join(__dirname, '../../');
const DATA_ROOT = Path.join(PROJECT_ROOT, 'src/tests/data/');
let dc: DebugClient;
setup( () => {
dc = new DebugClient('node', DEBUG_ADAPTER, 'mock');
return dc.start();
});
teardown( () => dc.stop() );
suite('basic', () => {
test('unknown request should produce error', done => {
dc.send('illegal_request').then(() => {
done(new Error("does not report error on unknown request"));
}).catch(() => {
done();
});
});
});
suite('initialize', () => {
test('should return supported features', () => {
return dc.initializeRequest().then(response => {
assert.equal(response.body.supportsConfigurationDoneRequest, true);
});
});
test('should produce error for invalid \'pathFormat\'', done => {
dc.initializeRequest({
adapterID: 'mock',
linesStartAt1: true,
columnsStartAt1: true,
pathFormat: 'url'
}).then(response => {
done(new Error("does not report error on invalid 'pathFormat' attribute"));
}).catch(err => {
// error expected
done();
});
});
});
suite('launch', () => {
test('should run program to the end', () => {
const PROGRAM = Path.join(DATA_ROOT, 'test.md');
return Promise.all([
dc.configurationSequence(),
dc.launch({ program: PROGRAM }),
dc.waitForEvent('terminated')
]);
});
test('should stop on entry', () => {
const PROGRAM = Path.join(DATA_ROOT, 'test.md');
const ENTRY_LINE = 1;
return Promise.all([
dc.configurationSequence(),
dc.launch({ program: PROGRAM, stopOnEntry: true }),
dc.assertStoppedLocation('entry', { line: ENTRY_LINE } )
]);
});
});
suite('setBreakpoints', () => {
test('should stop on a breakpoint', () => {
const PROGRAM = Path.join(DATA_ROOT, 'test.md');
const BREAKPOINT_LINE = 2;
return dc.hitBreakpoint({ program: PROGRAM }, { path: PROGRAM, line: BREAKPOINT_LINE } );
});
test('hitting a lazy breakpoint should send a breakpoint event', () => {
const PROGRAM = Path.join(DATA_ROOT, 'testLazyBreakpoint.md');
const BREAKPOINT_LINE = 3;
return Promise.all([
dc.hitBreakpoint({ program: PROGRAM }, { path: PROGRAM, line: BREAKPOINT_LINE, verified: false } ),
dc.waitForEvent('breakpoint').then((event : DebugProtocol.BreakpointEvent ) => {
assert.equal(event.body.breakpoint.verified, true, "event mismatch: verified");
})
//.........这里部分代码省略.........
示例5:
ipcMain.on('invoice-save', (event, clients, invoiceData, opts) => {
invoice.savePdf(clients, invoiceData,
path.join(__dirname, config.get('invoiceSavePath')))
})
示例6: pathExists
return Promise.all(paths.map((dir) => pathExists(path.join(dir, name))));
示例7: setup
* The complete set of contributors may be found at
* http://polymer.github.io/CONTRIBUTORS.txt
* Code distributed by Google as part of the polymer project is also
* subject to an additional IP rights grant found at
* http://polymer.github.io/PATENTS.txt
*/
import {assert} from 'chai';
import * as path from 'path';
import {Analyzer, applyEdits, FSUrlLoader, makeParseLoader} from 'polymer-analyzer';
import {Linter} from '../../linter';
import {registry} from '../../registry';
import {WarningPrettyPrinter} from '../util';
const fixtures_dir = path.join(__dirname, '..', '..', '..', 'test');
suite('deprecated-css-custom-property-syntax', () => {
let analyzer: Analyzer;
let warningPrinter: WarningPrettyPrinter;
let linter: Linter;
setup(() => {
analyzer = new Analyzer({urlLoader: new FSUrlLoader(fixtures_dir)});
warningPrinter = new WarningPrettyPrinter();
linter = new Linter(
registry.getRules(['deprecated-css-custom-property-syntax']), analyzer);
});
test('works in the trivial case', async() => {
const warnings = await linter.lint([]);
示例8: readDir
.map((scope: string) => readDir(join(path, "node_modules", scope))
.then((scoped) => scoped.map((f: string) => join(scope, f))),
示例9: join
.then((scoped) => scoped.map((f: string) => join(scope, f))),
示例10: readPackage
.then(() => readPackage(join(path, "package.json"), _cache))