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

Master #2

Open
wants to merge 2 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
2 changes: 2 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -6,3 +6,5 @@ node_modules
.npm
.node_repl_history
.idea
coverage
dist
13 changes: 13 additions & 0 deletions dist/console.dawg.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
'use strict';

Object.defineProperty(exports, '__esModule', {
value: true
});
var dawg = function dawg() {
return console.log('yo, dawg');
};

console.dawg = console.dawg || dawg;

exports['default'] = dawg;
module.exports = exports['default'];
38 changes: 38 additions & 0 deletions dist/console.dawg.spec.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,38 @@
'use strict';

// Utilities:
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { 'default': obj }; }

var _chai = require('chai');

var _chai2 = _interopRequireDefault(_chai);

var _sinon = require('sinon');

var _sinon2 = _interopRequireDefault(_sinon);

var _sinonChai = require('sinon-chai');

var _sinonChai2 = _interopRequireDefault(_sinonChai);

// Test setup:

// Under test:
var _consoleDawg = require('./console.dawg');

var _consoleDawg2 = _interopRequireDefault(_consoleDawg);

var expect = _chai2['default'].expect;
_chai2['default'].use(_sinonChai2['default']);

describe('console.dawg:', function () {
it('should call console.log with "dawg"', function () {
_sinon2['default'].stub(console, 'log');

(0, _consoleDawg2['default'])();

expect(console.log).to.have.been.calledWith('yo, dawg');

console.log.restore();
});
});
5 changes: 0 additions & 5 deletions index.js

This file was deleted.

14 changes: 10 additions & 4 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -2,22 +2,28 @@
"name": "console.dawg",
"version": "1.0.1",
"description": "",
"main": "index.js",
"main": "dist/console.dawg.js",
"scripts": {
"build": "tsc"
"build": "babel src -d dist",
"test": "babel-node ./node_modules/isparta/bin/isparta cover _mocha -- src/**/*.spec.js"
},
"repository": {
"type": "git",
"url": "git+https://github.com/elwynelwyn/console.dawg.git"
},
"keywords": [],
"author": "",
"license": "ISC",
"license": "MIT",
"bugs": {
"url": "https://github.com/elwynelwyn/console.dawg/issues"
},
"homepage": "https://github.com/elwynelwyn/console.dawg#readme",
"devDependencies": {
"typescript": "2.1.5"
"babel": "5.8.23",
"chai": "3.3.0",
"isparta": "3.1.0",
"mocha": "2.3.3",
"sinon": "1.17.1",
"sinon-chai": "2.8.0"
}
}
7 changes: 7 additions & 0 deletions src/console.dawg.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
'use strict';

const dawg = () => console.log('yo, dawg');

console.dawg = console.dawg || dawg

export default dawg;
25 changes: 25 additions & 0 deletions src/console.dawg.spec.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@
'use strict';

// Utilities:
import chai from 'chai';
import sinon from 'sinon';
import sinonChai from 'sinon-chai';

// Test setup:
const expect = chai.expect;
chai.use(sinonChai);

// Under test:
import dawg from './console.dawg';

describe('console.dawg:', () => {
it('should call console.log with "dawg"', () => {
sinon.stub(console, 'log');

dawg();

expect(console.log).to.have.been.calledWith('yo, dawg');

console.log.restore();
});
});
Loading