本文整理匯總了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))