<commit_before># chai-files

[![Build Status](https://travis-ci.org/Turbo87/chai-files.svg?branch=master)](https://travis-ci.org/Turbo87/chai-files)

file system assertions for chai<commit_msg>README: Add "Installation", "Usage" and "License" sections<commit_after>
chai-files
==============================================================================

[![Build Status](https://travis-ci.org/Turbo87/chai-files.svg?branch=master)](https://travis-ci.org/Turbo87/chai-files)

file system assertions for chai


Installation
------------------------------------------------------------------------------

```
npm install --save-dev chai-files
```

Usage
------------------------------------------------------------------------------

After importing `chai` add the following code to use `chai-files` assertions:

```js
var chai = require('chai');
var chaiFiles = require('../index');

chai.use(chaiFiles);

var expect = chai.expect;
var file = chaiFiles.file;
```


### expect(file(...)).to.exist

Check if a file exist:

```js
expect(file('index.js')).to.exist;
expect(file('index.coffee')).to.not.exist;
```


### expect(file(...)).to.contain(...)

Check if a file contains a string:

```js
expect(file('foo.txt')).to.contain('foo');
expect(file('foo.txt')).to.not.contain('bar');
```


License
------------------------------------------------------------------------------
chai-files is licensed under the [MIT License](LICENSE).
{'fraction_non_alphanumeric': 0.3708100558659218, 'fraction_numerical': 0.00558659217877095, 'mean_word_length': 2.3717647058823528, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 3, 'https://': 4, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '1579022', 'n_tokens_mistral': 434, 'n_tokens_neox': 413, 'n_words': 82}