cost 72 ms
如何修改/更改我的測試文件中的 ember mirage 響應?

[英]How to modify/change the ember mirage response in my tests file?

該應用程序使用 ember-cli-mirage 模擬數據並使用特定端點獲取特定響應。 Mocking 數據並將內容顯示到模板工作正常。 問題:我無法在我的測試文件中修改此端點GET /foos的響應。 /mirage/config.js tests/acceptance/foo-test.js ...

配置 Ember CLI Mirage 以支持使用 Embroider 進行 mirage 配置的肝負載

[英]Configure Ember CLI Mirage to support liverload for mirage configuration with Embroider

我有一個Ember.js應用程序,它使用Embroider和Ember CLI Mirage 。 遺憾的是實時重載不適用於 Mirage 配置更改。 對 Mirage 配置的更改不會觸發重建。 好像沒有看到mirage/文件夾。 我使用帶有--embroider標志的 Ember CLI v4.1 ...

ember 錯誤 this.store.findAll 不是 function

[英]ember error this.store.findAll is not a function

嘿,我正在閱讀 emberjs 教程,我遇到了這個我無法解決的問題。 當我嘗試從存儲中調用 findAll function 時,它會引發類型錯誤並說 findAll 不是 function。 當我使用 this.get() 方法時,它說它是經典的 ember object 方法,不能用於辛烷值類 ...

Ember Octane - Mirage 請求體 null

[英]Ember Octane - Mirage requestbody null

我是 ember.js 的新手,試圖用 mirage 做一些測試。 只有 model 的某些字段實現,但其他字段為 null。 由於我是新手,我不確定原因是否與這些線路有關 Account.js 海市蜃樓 - Config.js ...

如何在 Mirage js 中播種具有多態一對一關系的模型?

[英]How to seed models with polymorphic one to one relationship in mirage js?

這只是一個示例,我知道您通常會有多個評論,但是為了這個示例,假設我們有以下型號: 和以下工廠: 現在,當嘗試使用以下命令播種服務器時: 它確實播種但在檢查console.log(server.db.dump());時可評論的是 null... commentableId: null 。 為什么? ...

createList 在 Mirage js 中不拾取關系

[英]createList does not pick up relationship in Mirage js

我正在嘗試使用 Mirage js createList 工具創建屬於用戶的多個帖子。 我創建了具有對應關系的模型: 在seeds方法中,我試圖創建一個帖子列表並使用以下代碼將它們分配給用戶: 不幸的是,當我點擊this.get("/users"); 在 http 請求中,我收到海市蜃樓錯誤,我理解 ...

mirage.js 不適用於 angular 中的子 url 路徑(僅適用於根路徑)

[英]mirage.js will not work with sub url paths (only with root path) in angular

當通過根 url (localhost:4200/) 執行后端調用時,Mirage 確實匹配定義的路由,但是當我們在子頁面上執行后端調用時,ea:localhost:4200/process 將不起作用。 在調試海市蜃樓代碼時,它會嘗試通過在 url 前面加上“進程”來匹配。 因此,如果 BE 調 ...

Ember 關系不尊重測試環境中的 Model 自定義適配器

[英]Ember Relationships Are Not Respecting Model Custom Adapter in Test Environment

在我的 Ember.js 應用程序中,我有一個 model 公司,它帶有一個指向 API 的自定義適配器。 我還有一個用戶 model 和一個自定義適配器,該適配器指向不同的 API 以及與公司的 belongsTo 關系(通過 user#companyId 屬性)。 手動執行應用程序時,代碼中對 ...

從文件和 Ember CLI Mirage 中獲取內容

[英]Fetching content from file and Ember CLI Mirage

我的 Ember 應用程序中有一個組件,它從靜態降價文件返回數據。 didInsertElement() { fetch('markdown/faqs-content.md').then(response => { response.text().then(result =&g ...

如何在 ember-cli-mirage 中創建對象?

[英]How to create a object in ember-cli-mirage?

我有一個foo模型,它 hasMany bar和bar BeingsTo baz 。 當foo與其bar一起創建時,如何包含baz創建? 每當創建foo必須創建 10 個bar並為每個bar創建一個baz 在我的/factories/foo.js我有一個 ...

在 ember-cli-mirage(或任何 JavaScript)中生成 jwt web auth 令牌以在您的 ember 應用程序中使用

[英]Generate jwt web auth tokens in ember-cli-mirage (or any JavaScript) for use in your ember app

我在 Ember 團隊工作,該團隊為我們的 API 安全性實施了 djangorestframework-simplejwt。 這是一個很好的 API 解決方案,但是我們的 Mirage 用戶在一段時間后被注銷並且無法重新登錄我們的應用程序(用於測試、開發)。 我將問題追溯到 jwt 的工作原理,以 ...

您嘗試在模型中包含“dasherized-attribute-name”:example(1) 但模型上未定義名為“dasherizedAttributeName”的關聯

[英]You tried to include 'dasherized-attribute-name' with model:example(1) but no association named 'dasherizedAttributeName' is defined on the model

我們的應用程序主要使用下划線作為模型屬性創建,因此我們很難完全實現海市蜃樓。 當我們嘗試在模型上包含作為下划線屬性引用的相關模型時,我們收到以下錯誤: Mirage: You tried to include 'dasherized-attribute-name' with model:examp ...

當模型被側載時,ember-cli-mirage 失去關系

[英]ember-cli-mirage loses relationship when models are sideloaded

我有以下型號: 我使用RESTAdapter 。 我將 Mirage 配置定義如下: 這個 model 側載是我們應用程序的一部分,所以我必須使用它。 無論如何,您可以在這里看到響應很好,即它正確識別了外鍵等: 但是當我收到回復時,我無法從 web 訪問場地 - 它是null 。 余燼檢查員確認: ...

在瀏覽器中運行測試時禁用Ember Mirage

[英]Disable Ember Mirage when running tests in the browser

我希望能夠依次對我的Mirage服務器和實際服務器運行測試。 我已經閱讀了有關禁用Mirage的這些文檔 ,並且該文檔可以在開發環境中正常工作。 在下面添加代碼會在http:// localhost:4200禁用Mirage。 ENV['ember-cli-mirage ...

EmberJS Mirage Dependent屬性不會在補丁程序上更新

[英]EmberJS Mirage Dependent attributes do not update on patch

我已經在Mirage工廠中聲明了一個屬性,如下所示,並使用了docs中的Dependent屬性。 當我做補丁更新price我希望priceDisplay更新,就像computed屬性一樣,但是事實並非如此。 有誰知道這是否可能,或者這是Mirage限制嗎? ...

ember-cli-mirage嘗試對auth0(外部)URL進行存根

[英]ember-cli-mirage trying to stub auth0 (external) URL

我正在開發一個新的Ember.js項目,並使用ember-cli-mirage發出我的請求。 該項目將使用ember-simple-auth和Auth0進行用戶身份驗證。 我開始在我的項目中實施它們,但是當我嘗試使用Auth0登錄模式注冊我的Google帳戶時,在控制台中出現一個奇怪的錯誤: ...


 
粵ICP備18138465號  © 2020-2024 STACKOOM.COM