本文整理汇总了TypeScript中@feathersjs/feathers.default函数的典型用法代码示例。如果您正苦于以下问题:TypeScript default函数的具体用法?TypeScript default怎么用?TypeScript default使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。
在下文中一共展示了default函数的8个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的TypeScript代码示例。
示例1: it
it('uses default configKey', () => {
const otherApp = feathers();
const otherAuth = new AuthenticationBase(otherApp);
assert.ok(otherAuth);
assert.strictEqual(otherApp.get('defaultAuthentication'), 'authentication');
assert.deepStrictEqual(otherApp.get('authentication'), {});
});
示例2: before
before(() => {
const restApp = express.default(feathers())
.use(express.json())
.configure(express.rest())
.use(express.parseAuthentication('jwt'));
app = getApp(restApp as unknown as FeathersApplication) as express.Application;
app.use(express.errorHandler());
server = app.listen(9776);
});
示例3: it
it('has app.channel', () => {
const app = feathers().configure(channels());
assert.strictEqual(typeof app.channel, 'function');
assert.strictEqual(typeof (app as any)[keys.CHANNELS], 'object');
assert.strictEqual(app.channels.length, 0);
});
示例4: before
before(() => {
app = getApp(feathers().configure(primus({
transformer: 'websockets'
})));
server = app.listen(port);
});
示例5: it
it('errors when service does not exist', () => {
const app = feathers();
app.use('/authentication', new AuthenticationService(app));
app.configure(express());
});
示例6: beforeEach
beforeEach(() => {
connection = { testing: true };
provider = new EventEmitter();
options = {
emit: 'emit',
done: Promise.resolve(provider),
socketKey: 'test',
getParams () {
return connection;
}
};
app = feathers()
.configure(commons(options))
.use('/myservice', {
get (id, params) {
return Promise.resolve({ id, params });
},
create (data, params) {
return Promise.resolve(Object.assign({ params }, data));
}
});
return options.done;
});
示例7: beforeEach
beforeEach(() => {
app = feathers().configure(routing());
app.use('/my/service', {
get (id: string|number) {
return Promise.resolve({ id });
}
});
});
示例8: before
before(() => {
originalEnv.NODE_ENV = process.env.NODE_ENV;
originalEnv.NODE_CONFIG_DIR = process.env.NODE_CONFIG_DIR;
process.env.NODE_ENV = 'testing';
process.env.NODE_CONFIG_DIR = join(__dirname, 'config');
plugin = require('../lib');
app = feathers().configure(plugin());
});