1.0.1 • Published 2 years ago

@vhoyer/lazy-let v1.0.1

Weekly downloads
-
License
MIT
Repository
github
Last release
2 years ago

test-lazy-let

An utility for using lazy variables in a BDD test environment with nested describes, and its.

import { describe, it, expect, afterEach } from 'vitest';
import { lazylet } from '@vhoyer/lazy-let';
import { render } from '@testing-library/vue';
import MyFooter from '../my-footer.vue';

describe('dummy test', () => {
  const $0 = lazylet(afterEach, {
    value: () => 1,
    wrapper: () => render(MyFooter, {
      props: $0.props, // defaults to undefined
    }),
  });

  it('renders', () => {
    expect($0.wrapper.container).toMatchSnapshot();
  });

  describe('change props', () => {
    const $1 = $0(beforeEach, {
      props: () => ({ prop: $1.value }),
      propsAlternative: ($) => ({ prop: $.value }),
    });

    it('renders different', () => {
      expect($1.wrapper.container).toMatchSnapshot();
    });
  });
});
1.0.1

2 years ago

1.0.0

2 years ago

1.0.0-5

2 years ago

1.0.0-6

2 years ago

1.0.0-4

3 years ago

1.0.0-3

3 years ago

1.0.0-2

3 years ago

1.0.0-1

3 years ago

1.0.0-0

3 years ago