Repository URL to install this package:
|
Version:
2.0.11 ▾
|
import nock from 'nock'
import {
productListBaseUrl,
productBaseUrl,
searchBaseUrl,
searchsuggestionBaseUrl,
} from '../bootstrapper/api/config'
import {
getProductList,
getProduct,
getSearch,
getSearchSuggestions,
} from '../endpoints/catalog/stream/requests'
import {
productListParams,
searchParams,
searchSuggestionParams,
productParams,
} from '../endpoints/catalog/stream/defaultParams'
import {
fixtureProductListData,
fixtureProductData,
fixtureSearchData,
fixtureSearchSuggestionData,
} from '../endpoints/catalog/stream/fixtures'
// skip till until its revisited
describe.skip('How Nock Works', () => {
describe('with ProductList', () => {
let scope
beforeEach(() => {
// @note - this is done by using .toMock
scope = nock(productListBaseUrl)
.get('/fashionmen')
.query(productListParams)
.reply(200, fixtureProductListData)
})
afterEach(() => {
nock.cleanAll()
})
it('should reply with a fixture', async() => {
// const response = await getProductList({}, 'fashionmen')
console.warn('@michael - need to update params')
const response = await getProductList.path('fashionmen').doRequest()
expect(typeof response.body).toBe('object')
})
})
describe.skip('with ProductDetail', () => {
beforeEach(() => {})
afterEach(() => {})
})
describe.skip('with Search', () => {
beforeEach(() => {})
afterEach(() => {})
})
describe.skip('with Search Suggestions', () => {
beforeEach(() => {})
afterEach(() => {})
})
})