|
1 | 1 | import { SinonStub, stub, restore } from 'sinon'; |
2 | 2 | import Axios from 'axios'; |
3 | 3 |
|
4 | | -import { EVERCLEAR_CONFIG_URL, expect, getEverclearConfig, mock, parseEverclearConfig } from '../../src'; |
| 4 | +import { expect, getEverclearConfig, mock, parseEverclearConfig } from '../../src'; |
5 | 5 |
|
6 | 6 | describe('Helpers:Config', () => { |
7 | 7 | describe('#parseEverclearConfig', () => { |
@@ -31,26 +31,11 @@ describe('Helpers:Config', () => { |
31 | 31 | restore(); |
32 | 32 | }); |
33 | 33 |
|
34 | | - it('should return undefined if it axios.get fails and fallback fails', async () => { |
| 34 | + it('should return undefined if url fails', async () => { |
35 | 35 | getMock.resolves({}); |
36 | 36 | const config = await getEverclearConfig('http://foo.com'); |
37 | 37 | expect(config).to.be.undefined; |
38 | | - expect(getMock.firstCall.firstArg).to.be.eq('http://foo.com'); |
39 | | - expect(getMock.secondCall.firstArg).to.be.eq(EVERCLEAR_CONFIG_URL); |
40 | | - }); |
41 | | - |
42 | | - it('should query fallback if url fails', async () => { |
43 | | - getMock.onFirstCall().resolves({}); |
44 | | - const config = await getEverclearConfig('http://foo.com'); |
45 | | - expect(config).to.be.deep.eq(mock.config()); |
46 | | - expect(getMock.firstCall.firstArg).to.be.eq('http://foo.com'); |
47 | | - expect(getMock.secondCall.firstArg).to.be.eq(EVERCLEAR_CONFIG_URL); |
48 | | - }); |
49 | | - |
50 | | - it('should work with no url', async () => { |
51 | | - const config = await getEverclearConfig(); |
52 | | - expect(config).to.be.deep.eq(mock.config()); |
53 | | - expect(getMock.calledOnceWith(EVERCLEAR_CONFIG_URL)).to.be.true; |
| 38 | + expect(getMock.calledOnceWith('http://foo.com')).to.be.true; |
54 | 39 | }); |
55 | 40 |
|
56 | 41 | it('should work with url', async () => { |
|
0 commit comments