mirror of
https://github.com/TryGhost/Ghost.git
synced 2025-03-11 02:12:21 -05:00
Added default test dir and eslintrc
no-issue
This commit is contained in:
parent
986791d091
commit
ac847dbecd
6 changed files with 54 additions and 0 deletions
6
ghost/members-api/.eslintrc.js
Normal file
6
ghost/members-api/.eslintrc.js
Normal file
|
@ -0,0 +1,6 @@
|
|||
module.exports = {
|
||||
plugins: ['ghost'],
|
||||
extends: [
|
||||
'plugin:ghost/node',
|
||||
]
|
||||
};
|
6
ghost/members-api/test/.eslintrc.js
Normal file
6
ghost/members-api/test/.eslintrc.js
Normal file
|
@ -0,0 +1,6 @@
|
|||
module.exports = {
|
||||
plugins: ['ghost'],
|
||||
extends: [
|
||||
'plugin:ghost/test',
|
||||
]
|
||||
};
|
10
ghost/members-api/test/hello.test.js
Normal file
10
ghost/members-api/test/hello.test.js
Normal file
|
@ -0,0 +1,10 @@
|
|||
// Switch these lines once there are useful utils
|
||||
// const testUtils = require('./utils');
|
||||
require('./utils');
|
||||
|
||||
describe('Hello world', function () {
|
||||
it('Runs a test', function () {
|
||||
// TODO: Write me!
|
||||
'hello'.should.eql('hello');
|
||||
});
|
||||
});
|
11
ghost/members-api/test/utils/assertions.js
Normal file
11
ghost/members-api/test/utils/assertions.js
Normal file
|
@ -0,0 +1,11 @@
|
|||
/**
|
||||
* Custom Should Assertions
|
||||
*
|
||||
* Add any custom assertions to this file.
|
||||
*/
|
||||
|
||||
// Example Assertion
|
||||
// should.Assertion.add('ExampleAssertion', function () {
|
||||
// this.params = {operator: 'to be a valid Example Assertion'};
|
||||
// this.obj.should.be.an.Object;
|
||||
// });
|
11
ghost/members-api/test/utils/index.js
Normal file
11
ghost/members-api/test/utils/index.js
Normal file
|
@ -0,0 +1,11 @@
|
|||
/**
|
||||
* Test Utilities
|
||||
*
|
||||
* Shared utils for writing tests
|
||||
*/
|
||||
|
||||
// Require overrides - these add globals for tests
|
||||
require('./overrides');
|
||||
|
||||
// Require assertions - adds custom should assertions
|
||||
require('./assertions');
|
10
ghost/members-api/test/utils/overrides.js
Normal file
10
ghost/members-api/test/utils/overrides.js
Normal file
|
@ -0,0 +1,10 @@
|
|||
// This file is required before any test is run
|
||||
|
||||
// Taken from the should wiki, this is how to make should global
|
||||
// Should is a global in our eslint test config
|
||||
global.should = require('should').noConflict();
|
||||
should.extend();
|
||||
|
||||
// Sinon is a simple case
|
||||
// Sinon is a global in our eslint test config
|
||||
global.sinon = require('sinon');
|
Loading…
Add table
Reference in a new issue