experimentals-test.js 679 B

123456789101112131415161718192021222324252627282930313233
  1. const nock = require('nock')
  2. const GitHub = require('../../')
  3. require('../mocha-node-setup')
  4. describe('authentication plugin', () => {
  5. let github
  6. beforeEach(() => {
  7. github = new GitHub({
  8. baseUrl: 'https://authentication-plugin-test-host.com'
  9. })
  10. })
  11. it('OAuth authentication with URL containing ?', () => {
  12. nock('https://authentication-plugin-test-host.com')
  13. .get('/')
  14. .query({foo: 'bar', client_id: 'oauthkey', client_secret: 'oauthsecret'})
  15. .reply(200, {})
  16. github.authenticate({
  17. type: 'oauth',
  18. key: 'oauthkey',
  19. secret: 'oauthsecret'
  20. })
  21. return github.request({
  22. url: '/?foo=bar'
  23. })
  24. })
  25. })