mirror of
https://github.com/mountain-loop/yaak.git
synced 2026-04-21 00:01:22 +02:00
Fix tests
This commit is contained in:
@@ -1,10 +1,12 @@
|
|||||||
import { describe, expect, test } from 'vitest';
|
import { describe, expect, test } from 'vitest';
|
||||||
import { pluginHookExport } from '../src';
|
import { pluginHookExport } from '../src';
|
||||||
|
|
||||||
|
const ctx = {};
|
||||||
|
|
||||||
describe('exporter-curl', () => {
|
describe('exporter-curl', () => {
|
||||||
test('Exports GET with params', () => {
|
test('Exports GET with params', () => {
|
||||||
expect(
|
expect(
|
||||||
pluginHookExport({
|
pluginHookExport(ctx, {
|
||||||
url: 'https://yaak.app',
|
url: 'https://yaak.app',
|
||||||
urlParameters: [
|
urlParameters: [
|
||||||
{ name: 'a', value: 'aaa' },
|
{ name: 'a', value: 'aaa' },
|
||||||
@@ -18,7 +20,7 @@ describe('exporter-curl', () => {
|
|||||||
});
|
});
|
||||||
test('Exports POST with url form data', () => {
|
test('Exports POST with url form data', () => {
|
||||||
expect(
|
expect(
|
||||||
pluginHookExport({
|
pluginHookExport(ctx, {
|
||||||
url: 'https://yaak.app',
|
url: 'https://yaak.app',
|
||||||
method: 'POST',
|
method: 'POST',
|
||||||
bodyType: 'application/x-www-form-urlencoded',
|
bodyType: 'application/x-www-form-urlencoded',
|
||||||
@@ -37,7 +39,7 @@ describe('exporter-curl', () => {
|
|||||||
|
|
||||||
test('Exports PUT with multipart form', () => {
|
test('Exports PUT with multipart form', () => {
|
||||||
expect(
|
expect(
|
||||||
pluginHookExport({
|
pluginHookExport(ctx, {
|
||||||
url: 'https://yaak.app',
|
url: 'https://yaak.app',
|
||||||
method: 'PUT',
|
method: 'PUT',
|
||||||
bodyType: 'multipart/form-data',
|
bodyType: 'multipart/form-data',
|
||||||
@@ -62,7 +64,7 @@ describe('exporter-curl', () => {
|
|||||||
|
|
||||||
test('Exports JSON body', () => {
|
test('Exports JSON body', () => {
|
||||||
expect(
|
expect(
|
||||||
pluginHookExport({
|
pluginHookExport(ctx, {
|
||||||
url: 'https://yaak.app',
|
url: 'https://yaak.app',
|
||||||
method: 'POST',
|
method: 'POST',
|
||||||
bodyType: 'application/json',
|
bodyType: 'application/json',
|
||||||
@@ -82,7 +84,7 @@ describe('exporter-curl', () => {
|
|||||||
|
|
||||||
test('Exports multi-line JSON body', () => {
|
test('Exports multi-line JSON body', () => {
|
||||||
expect(
|
expect(
|
||||||
pluginHookExport({
|
pluginHookExport(ctx, {
|
||||||
url: 'https://yaak.app',
|
url: 'https://yaak.app',
|
||||||
method: 'POST',
|
method: 'POST',
|
||||||
bodyType: 'application/json',
|
bodyType: 'application/json',
|
||||||
@@ -102,7 +104,7 @@ describe('exporter-curl', () => {
|
|||||||
|
|
||||||
test('Exports headers', () => {
|
test('Exports headers', () => {
|
||||||
expect(
|
expect(
|
||||||
pluginHookExport({
|
pluginHookExport(ctx, {
|
||||||
headers: [
|
headers: [
|
||||||
{ name: 'a', value: 'aaa' },
|
{ name: 'a', value: 'aaa' },
|
||||||
{ name: 'b', value: 'bbb', enabled: true },
|
{ name: 'b', value: 'bbb', enabled: true },
|
||||||
@@ -114,7 +116,7 @@ describe('exporter-curl', () => {
|
|||||||
|
|
||||||
test('Basic auth', () => {
|
test('Basic auth', () => {
|
||||||
expect(
|
expect(
|
||||||
pluginHookExport({
|
pluginHookExport(ctx, {
|
||||||
url: 'https://yaak.app',
|
url: 'https://yaak.app',
|
||||||
authenticationType: 'basic',
|
authenticationType: 'basic',
|
||||||
authentication: {
|
authentication: {
|
||||||
@@ -127,7 +129,7 @@ describe('exporter-curl', () => {
|
|||||||
|
|
||||||
test('Broken basic auth', () => {
|
test('Broken basic auth', () => {
|
||||||
expect(
|
expect(
|
||||||
pluginHookExport({
|
pluginHookExport(ctx, {
|
||||||
url: 'https://yaak.app',
|
url: 'https://yaak.app',
|
||||||
authenticationType: 'basic',
|
authenticationType: 'basic',
|
||||||
authentication: {},
|
authentication: {},
|
||||||
@@ -137,7 +139,7 @@ describe('exporter-curl', () => {
|
|||||||
|
|
||||||
test('Digest auth', () => {
|
test('Digest auth', () => {
|
||||||
expect(
|
expect(
|
||||||
pluginHookExport({
|
pluginHookExport(ctx, {
|
||||||
url: 'https://yaak.app',
|
url: 'https://yaak.app',
|
||||||
authenticationType: 'digest',
|
authenticationType: 'digest',
|
||||||
authentication: {
|
authentication: {
|
||||||
@@ -150,7 +152,7 @@ describe('exporter-curl', () => {
|
|||||||
|
|
||||||
test('Bearer auth', () => {
|
test('Bearer auth', () => {
|
||||||
expect(
|
expect(
|
||||||
pluginHookExport({
|
pluginHookExport(ctx, {
|
||||||
url: 'https://yaak.app',
|
url: 'https://yaak.app',
|
||||||
authenticationType: 'bearer',
|
authenticationType: 'bearer',
|
||||||
authentication: {
|
authentication: {
|
||||||
@@ -162,7 +164,7 @@ describe('exporter-curl', () => {
|
|||||||
|
|
||||||
test('Broken bearer auth', () => {
|
test('Broken bearer auth', () => {
|
||||||
expect(
|
expect(
|
||||||
pluginHookExport({
|
pluginHookExport(ctx, {
|
||||||
url: 'https://yaak.app',
|
url: 'https://yaak.app',
|
||||||
authenticationType: 'bearer',
|
authenticationType: 'bearer',
|
||||||
authentication: {
|
authentication: {
|
||||||
|
|||||||
Reference in New Issue
Block a user