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