2.3.0 • Published 1 month ago

@japa/file-system v2.3.0

Weekly downloads
-
License
MIT
Repository
github
Last release
1 month ago

@japa/file-system

File system plugin for Japa

gh-workflow-image npm-image license-image

The file system plugin allows you to easily manage files and directories during tests and write assertions against them.

Complete API documentation

Installation

You can install the plugin from the npm packages registry as follows.

npm i -D @japa/file-system

Usage

The next step is registering the plugin inside the plugins array.

import { fileSystem } from '@japa/file-system'

configure({
  plugins: [fileSystem()]
})

Once the plugin has been registered, you can access the fs property from the test context. The fs property exposes the helper functions to read and write files. For example:

test('read rc file', async ({ fs }) => {
  await fs.write('rc.json', JSON.stringify({
    foo: 'bar'
  }))

  await runMethodThatNeedsRcFile()
})
2.3.0

1 month ago

2.2.0

4 months ago

2.1.1

5 months ago

2.1.0

5 months ago

2.0.0-2

8 months ago

2.0.1

6 months ago

2.0.0

7 months ago

2.0.0-1

11 months ago

1.1.0

11 months ago

2.0.0-0

11 months ago

1.0.1

1 year ago

1.0.0

1 year ago