mirror of
https://github.com/morten-olsen/mini-loader.git
synced 2026-02-08 01:36:26 +01:00
qa: add e2e tests
This commit is contained in:
@@ -1,10 +1,7 @@
|
||||
import { Command } from 'commander';
|
||||
import { createClient } from '../../client/client.js';
|
||||
import { step } from '../../utils/step.js';
|
||||
import { Context } from '../../context/context.js';
|
||||
import { dirname, resolve } from 'path';
|
||||
import { mkdir, writeFile } from 'fs/promises';
|
||||
import { Config } from '../../config/config.js';
|
||||
import { getApi } from '../../utils/command.js';
|
||||
|
||||
const pull = new Command('pull');
|
||||
|
||||
@@ -13,12 +10,8 @@ pull
|
||||
.argument('<artifact-id>', 'Artifact ID')
|
||||
.argument('<file>', 'File to save')
|
||||
.action(async (id, file) => {
|
||||
const config = new Config();
|
||||
const context = new Context(config.context);
|
||||
const { step, client } = getApi(pull);
|
||||
const target = resolve(file);
|
||||
const client = await step('Connecting to server', async () => {
|
||||
return createClient(context);
|
||||
});
|
||||
const artifact = await step('Getting artifact', async () => {
|
||||
const result = await client.artifacts.get.query(id);
|
||||
if (!result) {
|
||||
|
||||
Reference in New Issue
Block a user