refactor: Add IRequestOptions type to helpers.request for more type safety (no-changelog) (#8563)
Co-authored-by: कारतोफ्फेलस्क्रिप्ट™ <aditya@netroy.in>
This commit is contained in:
@@ -10,7 +10,7 @@ jest.mock('../../../../v2/transport', () => {
|
||||
const originalModule = jest.requireActual('../../../../v2/transport');
|
||||
return {
|
||||
...originalModule,
|
||||
microsoftApiRequest: jest.fn(async function (method: string) {
|
||||
microsoftApiRequest: jest.fn(async function (method: IHttpRequestMethods) {
|
||||
if (method === 'POST') {
|
||||
return {
|
||||
style: 'TableStyleMedium2',
|
||||
|
||||
@@ -10,7 +10,7 @@ jest.mock('../../../../v2/transport', () => {
|
||||
const originalModule = jest.requireActual('../../../../v2/transport');
|
||||
return {
|
||||
...originalModule,
|
||||
microsoftApiRequest: jest.fn(async function (method: string, resource: string) {
|
||||
microsoftApiRequest: jest.fn(async function (method: IHttpRequestMethods, resource: string) {
|
||||
if (method === 'GET') {
|
||||
return {
|
||||
value: [
|
||||
|
||||
@@ -10,7 +10,7 @@ jest.mock('../../../../v2/transport', () => {
|
||||
const originalModule = jest.requireActual('../../../../v2/transport');
|
||||
return {
|
||||
...originalModule,
|
||||
microsoftApiRequest: jest.fn(async function (method: string) {
|
||||
microsoftApiRequest: jest.fn(async function (method: IHttpRequestMethods) {
|
||||
if (method === 'POST') {
|
||||
return {
|
||||
address: 'Sheet4!A1:D5',
|
||||
|
||||
@@ -10,7 +10,7 @@ jest.mock('../../../../v2/transport', () => {
|
||||
const originalModule = jest.requireActual('../../../../v2/transport');
|
||||
return {
|
||||
...originalModule,
|
||||
microsoftApiRequest: jest.fn(async function (method: string) {
|
||||
microsoftApiRequest: jest.fn(async function (method: IHttpRequestMethods) {
|
||||
if (method === 'DELETE') {
|
||||
return;
|
||||
}
|
||||
|
||||
@@ -10,7 +10,7 @@ jest.mock('../../../../v2/transport', () => {
|
||||
const originalModule = jest.requireActual('../../../../v2/transport');
|
||||
return {
|
||||
...originalModule,
|
||||
microsoftApiRequest: jest.fn(async function (method: string) {
|
||||
microsoftApiRequest: jest.fn(async function (method: IHttpRequestMethods) {
|
||||
if (method === 'GET') {
|
||||
return {
|
||||
value: [
|
||||
|
||||
@@ -12,7 +12,7 @@ jest.mock('../../../../v2/transport', () => {
|
||||
...originalModule,
|
||||
microsoftApiRequestAllItemsSkip: jest.fn(async function (
|
||||
_property: string,
|
||||
_method: string,
|
||||
_method: IHttpRequestMethods,
|
||||
endpoint: string,
|
||||
) {
|
||||
if (endpoint.includes('columns')) {
|
||||
|
||||
Reference in New Issue
Block a user