Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

slugify and update dependencies #14

Open
wants to merge 6 commits into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
7 changes: 2 additions & 5 deletions .travis.yml
Original file line number Diff line number Diff line change
@@ -1,12 +1,9 @@
---
language: node_js
node_js:
- "6"

sudo: false

cache:
directories:
- node_modules

install:
- npm install

Expand Down
3 changes: 2 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
# Nock VCR Recorder Mocha [![Build Status](https://travis-ci.org/poetic/nock-vcr-recorder-mocha.svg?branch=master)](https://travis-ci.org/poetic/nock-vcr-recorder-mocha)
# Nock VCR Recorder Mocha
[![Build Status](https://travis-ci.com/geoffdutton/nock-vcr-recorder-mocha.svg?branch=master)](https://travis-ci.com/geoffdutton/nock-vcr-recorder-mocha)

## About

Expand Down
5 changes: 4 additions & 1 deletion lib/describe.js
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@ var RSVP = require('rsvp');
var path = require('path');
var vcr = require('nock-vcr-recorder');
var wrapMochaFn = require('./wrap-mocha-fn');
var slug = require('slug');

module.exports = wrapMochaFn(describe, function(name, options, callback) {
callback.call(this);
Expand Down Expand Up @@ -43,5 +44,7 @@ function getCassetteName(ctx) {
}
cassettePath.push(ctx.currentTest.title);

return path.join.apply(path, cassettePath);
return path.join.apply(path, cassettePath.map(function(pathPiece) {
return slug(pathPiece).toLowerCase();
}));
}
4 changes: 4 additions & 0 deletions lib/it.js
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@ var RSVP = require('rsvp');
var path = require('path');
var vcr = require('nock-vcr-recorder');
var wrapMochaFn = require('./wrap-mocha-fn');
var slug = require('slug');

module.exports = wrapMochaFn(it, function(name, options, callback) {
var testCtx = this;
Expand Down Expand Up @@ -36,6 +37,9 @@ function getCassetteName(ctx) {
}
}
cassettePath.push(ctx.test.title);
cassettePath = cassettePath.map(function(pathPiece) {
return slug(pathPiece).toLowerCase();
});

return path.join.apply(path, cassettePath);
}
Loading