-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #3 from stitchng/develop
Develop
- Loading branch information
Showing
10 changed files
with
145 additions
and
28 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -103,7 +103,7 @@ MIT | |
|
||
```bash | ||
|
||
npm run lint | ||
npm run lint | ||
|
||
npm run test | ||
|
||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,48 @@ | ||
'use strict' | ||
|
||
/* | ||
* adonis-bugsnag | ||
* | ||
* (c) Harminder Virk <virk@adonisjs.com> | ||
* | ||
* For the full copyright and license information, please view the LICENSE | ||
* file that was distributed with this source code. | ||
*/ | ||
|
||
const test = require('japa') | ||
const path = require('path') | ||
const { Config, Env, Helpers } = require('@adonisjs/sink') | ||
const { ioc } = require('@adonisjs/fold') | ||
const BugSnagMiddleware = require('../src/BugSnag/Middleware/BugSnagUser.js') | ||
const BugSnagProvider = require('../providers/BugSnagProvider.js') | ||
const BugSnag = require('../src/BugSnag/index.js') | ||
|
||
test.group('AdonisJS BugSnag Provider Test(s)', (group) => { | ||
group.before(() => { | ||
ioc.singleton('Adonis/Src/Config', () => { | ||
let config = new Config() | ||
config.set('bugsnag.apiKey', 'q24cd5317608c5353de0794576ee015q') | ||
config.set('bugsnag.trackViaSession', false) | ||
return config | ||
}) | ||
|
||
ioc.singleton('Env', () => { | ||
let env = new Env() | ||
env.set('NODE_ENV', 'development') | ||
return env | ||
}) | ||
|
||
ioc.singleton('Helpers', () => { | ||
let helpers = new Helpers(path.join(__dirname, '..')) | ||
return helpers | ||
}) | ||
}) | ||
|
||
test('provider instance registers instance(s) as expected', async (assert) => { | ||
let provider = new BugSnagProvider(ioc) | ||
provider.register() | ||
|
||
assert.instanceOf(ioc.use('Adonis/Addons/BugSnag'), BugSnag) | ||
assert.instanceOf(ioc.use('Adonis/Middleware/BugSnagUser'), BugSnagMiddleware) | ||
}) | ||
}) |