mirror of
https://github.com/mountain-loop/yaak.git
synced 2026-04-20 07:41:22 +02:00
Merge main into proxy branch (formatting and docs)
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
This commit is contained in:
@@ -1,14 +1,14 @@
|
||||
import { describe, expect, test } from 'vitest';
|
||||
import { migrateImport } from '../src';
|
||||
import { describe, expect, test } from "vite-plus/test";
|
||||
import { migrateImport } from "../src";
|
||||
|
||||
describe('importer-yaak', () => {
|
||||
test('Skips invalid imports', () => {
|
||||
expect(migrateImport('not JSON')).toBeUndefined();
|
||||
expect(migrateImport('[]')).toBeUndefined();
|
||||
describe("importer-yaak", () => {
|
||||
test("Skips invalid imports", () => {
|
||||
expect(migrateImport("not JSON")).toBeUndefined();
|
||||
expect(migrateImport("[]")).toBeUndefined();
|
||||
expect(migrateImport(JSON.stringify({ resources: {} }))).toBeUndefined();
|
||||
});
|
||||
|
||||
test('converts schema 1 to 2', () => {
|
||||
test("converts schema 1 to 2", () => {
|
||||
const imported = migrateImport(
|
||||
JSON.stringify({
|
||||
yaakSchema: 1,
|
||||
@@ -26,23 +26,23 @@ describe('importer-yaak', () => {
|
||||
}),
|
||||
);
|
||||
});
|
||||
test('converts schema 2 to 3', () => {
|
||||
test("converts schema 2 to 3", () => {
|
||||
const imported = migrateImport(
|
||||
JSON.stringify({
|
||||
yaakSchema: 2,
|
||||
resources: {
|
||||
environments: [
|
||||
{
|
||||
id: 'e_1',
|
||||
workspaceId: 'w_1',
|
||||
name: 'Production',
|
||||
variables: [{ name: 'E1', value: 'E1!' }],
|
||||
id: "e_1",
|
||||
workspaceId: "w_1",
|
||||
name: "Production",
|
||||
variables: [{ name: "E1", value: "E1!" }],
|
||||
},
|
||||
],
|
||||
workspaces: [
|
||||
{
|
||||
id: 'w_1',
|
||||
variables: [{ name: 'W1', value: 'W1!' }],
|
||||
id: "w_1",
|
||||
variables: [{ name: "W1", value: "W1!" }],
|
||||
},
|
||||
],
|
||||
},
|
||||
@@ -54,23 +54,23 @@ describe('importer-yaak', () => {
|
||||
resources: {
|
||||
workspaces: [
|
||||
{
|
||||
id: 'w_1',
|
||||
id: "w_1",
|
||||
},
|
||||
],
|
||||
environments: [
|
||||
{
|
||||
id: 'e_1',
|
||||
workspaceId: 'w_1',
|
||||
name: 'Production',
|
||||
variables: [{ name: 'E1', value: 'E1!' }],
|
||||
parentModel: 'environment',
|
||||
id: "e_1",
|
||||
workspaceId: "w_1",
|
||||
name: "Production",
|
||||
variables: [{ name: "E1", value: "E1!" }],
|
||||
parentModel: "environment",
|
||||
parentId: null,
|
||||
},
|
||||
{
|
||||
id: 'GENERATE_ID::base_env_w_1',
|
||||
workspaceId: 'w_1',
|
||||
name: 'Global Variables',
|
||||
variables: [{ name: 'W1', value: 'W1!' }],
|
||||
id: "GENERATE_ID::base_env_w_1",
|
||||
workspaceId: "w_1",
|
||||
name: "Global Variables",
|
||||
variables: [{ name: "W1", value: "W1!" }],
|
||||
},
|
||||
],
|
||||
},
|
||||
@@ -78,35 +78,35 @@ describe('importer-yaak', () => {
|
||||
);
|
||||
});
|
||||
|
||||
test('converts schema 4 to 5', () => {
|
||||
test("converts schema 4 to 5", () => {
|
||||
const imported = migrateImport(
|
||||
JSON.stringify({
|
||||
yaakSchema: 2,
|
||||
resources: {
|
||||
environments: [
|
||||
{
|
||||
id: 'e_1',
|
||||
workspaceId: 'w_1',
|
||||
id: "e_1",
|
||||
workspaceId: "w_1",
|
||||
base: false,
|
||||
name: 'Production',
|
||||
variables: [{ name: 'E1', value: 'E1!' }],
|
||||
name: "Production",
|
||||
variables: [{ name: "E1", value: "E1!" }],
|
||||
},
|
||||
{
|
||||
id: 'e_1',
|
||||
workspaceId: 'w_1',
|
||||
id: "e_1",
|
||||
workspaceId: "w_1",
|
||||
base: true,
|
||||
name: 'Global Variables',
|
||||
variables: [{ name: 'G1', value: 'G1!' }],
|
||||
name: "Global Variables",
|
||||
variables: [{ name: "G1", value: "G1!" }],
|
||||
},
|
||||
],
|
||||
folders: [
|
||||
{
|
||||
id: 'f_1',
|
||||
id: "f_1",
|
||||
},
|
||||
],
|
||||
workspaces: [
|
||||
{
|
||||
id: 'w_1',
|
||||
id: "w_1",
|
||||
},
|
||||
],
|
||||
},
|
||||
@@ -118,30 +118,30 @@ describe('importer-yaak', () => {
|
||||
resources: {
|
||||
workspaces: [
|
||||
{
|
||||
id: 'w_1',
|
||||
id: "w_1",
|
||||
},
|
||||
],
|
||||
folders: [
|
||||
{
|
||||
id: 'f_1',
|
||||
id: "f_1",
|
||||
},
|
||||
],
|
||||
environments: [
|
||||
{
|
||||
id: 'e_1',
|
||||
workspaceId: 'w_1',
|
||||
name: 'Production',
|
||||
variables: [{ name: 'E1', value: 'E1!' }],
|
||||
parentModel: 'environment',
|
||||
id: "e_1",
|
||||
workspaceId: "w_1",
|
||||
name: "Production",
|
||||
variables: [{ name: "E1", value: "E1!" }],
|
||||
parentModel: "environment",
|
||||
parentId: null,
|
||||
},
|
||||
{
|
||||
id: 'e_1',
|
||||
workspaceId: 'w_1',
|
||||
name: 'Global Variables',
|
||||
parentModel: 'workspace',
|
||||
id: "e_1",
|
||||
workspaceId: "w_1",
|
||||
name: "Global Variables",
|
||||
parentModel: "workspace",
|
||||
parentId: null,
|
||||
variables: [{ name: 'G1', value: 'G1!' }],
|
||||
variables: [{ name: "G1", value: "G1!" }],
|
||||
},
|
||||
],
|
||||
},
|
||||
|
||||
Reference in New Issue
Block a user