本文整理汇总了TypeScript中src/wingbow/database/store._mockStore函数的典型用法代码示例。如果您正苦于以下问题:TypeScript _mockStore函数的具体用法?TypeScript _mockStore怎么用?TypeScript _mockStore使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。
在下文中一共展示了_mockStore函数的5个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的TypeScript代码示例。
示例1: setRaw
storeNames.forEach(storeName => {
setRaw(storeKey, storeName, `aaa`, `AAA`);
expect(getRaw(storeKey, storeName, `aaa`)).toBe(`AAA`);
const store = new Map();
store.set(storeKey, {aaa: `MOCKED_AAA`});
_mockStore(storeName, store);
expect(getRaw(storeKey, storeName, `aaa`)).toBe(`MOCKED_AAA`);
});
开发者ID:efueger,项目名称:wingbow,代码行数:8,代码来源:store.spec.ts
示例2: it
it(`should exclude stored prototypal proterties`, () => {
const map = new Map();
_mockStore(`attributes`, map);
let that = null;
class MockModel extends UnprotectedModel {
constructor(attributes :JsonableObject) {
super(attributes);
that = this;
}
public fillable() { return [`q`, `r`, `s`]; }
}
const attributes = {q: 17, r: 18, s: 19};
const model = new MockModel(attributes);
expect(model.getAttributes()).toEqual({q: 17, r: 18, s: 19});
function Store() {
this.x = 24;
this.z = 26;
}
Store.prototype.y = 25;
const store = new Store();
map.set(that, store);
expect(model.getAttributes()).toEqual({x: 24, z: 26});
});
开发者ID:efueger,项目名称:wingbow,代码行数:23,代码来源:model.spec.ts
示例3: beforeEach
beforeEach(() => {
mockAttributesStore = new Map();
_mockStore(`attributes`, mockAttributesStore);
attributes = {a: 1, b: 2, c: 3};
model = new MockModel(attributes);
});
开发者ID:efueger,项目名称:wingbow,代码行数:6,代码来源:model.spec.ts
示例4: expect
expect(() => {
_mockStore(`STORE_NAME_NOT_DEFINED`, store);
}).toThrowError(IllegalStoreTypeError);
开发者ID:efueger,项目名称:wingbow,代码行数:3,代码来源:store.spec.ts
示例5: Map
storeNames.forEach(storeName => {
const store = new Map();
_mockStore(storeName, store);
localStores[storeName] = store;
});
开发者ID:efueger,项目名称:wingbow,代码行数:5,代码来源:store.spec.ts
注:本文中的src/wingbow/database/store._mockStore函数示例由纯净天空整理自Github/MSDocs等源码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。 |
请发表评论