當前位置: 首頁>>代碼示例>>TypeScript>>正文


TypeScript store._mockStore函數代碼示例

本文整理匯總了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;未經允許,請勿轉載。