🚀 Big News: Socket Acquires Coana to Bring Reachability Analysis to Every Appsec Team.Learn more
Socket
DemoInstallSign in
Socket

@spartez-software/jira-test

Package Overview
Dependencies
Maintainers
0
Versions
67
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@spartez-software/jira-test

jira integration tests helper lib

0.0.74
latest
Source
npm
Version published
Weekly downloads
988
0.2%
Maintainers
0
Weekly downloads
 
Created
Source

jira-test (Beta)

helper lib - integration tests

prerequisites

  • ability to run tests using jest

installation

npm install @spartez-software/jira-test --save-dev

setup

  • go get yourself a jira cloud instance
  • setup .env
TEST_JIRA_URL=https://your-cloud-jira-test-name.atlassian.net
TEST_JIRA_USER=user-that-will-make-changes-in-jira@spartez-software.com
TEST_JIRA_USER_TOKEN=pst! it is a secret, an api token!

usage (jest/typescript example)

import { step, TestLogger } from '@spartez-software/test-utils';
import { Jira, ProjectTemplateKeys } from '@spartez-software/jira-test';

describe('jira tests', () => {
    jest.retryTimes(1);
    jest.setTimeout(240000);

    const jira = Jira.getJiraFromEnv();
    const logger = new TestLogger();

    let project: string;

    it('Should create and destroy project with 2 issues', async () => {
        await step('Create jira Project', async () => {
            project = await jira.createProject();
            expect(project).toBeDefined();
        });

        logger.log(project);

        await step('adding jira issue', async () => {
            const issues = [{ summary: 'ala', type: 'Bug' }, { summary: 'pola', type: 'Bug' }];
            await jira.createSimpleIssues(project, issues);
        });
    });

    afterEach(async () => {
        await step('Delete jira project', async () => {
            if (project) {
                await jira.deleteProject(project);
            }
        });
    });

    it('Should create and destroy servicedesk project', async () => {
        await step('Create jira Project', async () => {
            project = await jira.createProjectFromTemplate(ProjectTemplateKeys.serviceDesk.simplifiedGeneralServiceDesk);
            expect(project).toBeDefined();
        });
        logger.log(project);

        await step('adding jira issue', async () => {
            const issues = [{ summary: 'ala', type: 'Task' }, { summary: 'pola', type: 'Task' }];
            await jira.createSimpleIssues(project, issues);
        });
    });

    afterEach(async () => {
        await step('Delete jira project', async () => {
            if (project) {
                await jira.deleteProject(project);
            }
        });
    });
});

FAQs

Package last updated on 05 Dec 2024

Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts