Skip to content

t.context Functions #146

Open
Open
@schnittstabil

Description

@schnittstabil

I know, I can easily workaround this, but I don't know if there is a good reason for use-t-well to complain#L60-L71 about my use case:

test.beforeEach(t => {
    const tmp = tempfile();
    t.context = (...paths) => path.join(tmp, ...paths);
});

test(async t => {
    mkdirp.sync(t.context('src')); // <--- Unknown assertion method `context`

    // await fn(…);

    t.true(fs.lstatSync(t.context('dest')).isDirectory());
    t.true(fs.lstatSync(t.context('dest', 'src')).isDirectory());
});

NB: avajs/ava#106 (comment) and ava/readme.md:

By default t.context is an object but you can reassign it

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions