Browse Source

Merge "Export supported services from index.js"

Jenkins 2 years ago
parent
commit
3221a3513d
3 changed files with 2 additions and 65 deletions
  1. 2
    10
      src/index.js
  2. 0
    23
      test/functional/indexTest.js
  3. 0
    32
      test/unit/indexTest.js

+ 2
- 10
src/index.js View File

@@ -1,10 +1,2 @@
1
-import 'isomorphic-fetch';
2
-
3
-export default class Test {
4
-  getUrl (url) {
5
-    return fetch(url)
6
-      .then((response) => {
7
-        return response;
8
-      });
9
-  }
10
-}
1
+export {default as Keystone} from './keystone';
2
+export {default as Glance} from './glance';

+ 0
- 23
test/functional/indexTest.js View File

@@ -1,23 +0,0 @@
1
-import Test from "../../src/index";
2
-import config from "./helpers/cloudsConfig";
3
-
4
-describe("Simple functional test", () => {
5
-
6
-  it("should call keystone URL", (done) => {
7
-    const testKeystone = function(response) {
8
-      expect(response.status).toBe(200);
9
-      done();
10
-    };
11
-
12
-    const failTest = function(error) {
13
-      expect(error).toBeUndefined();
14
-      done();
15
-    };
16
-
17
-    const t = new Test();
18
-    t.getUrl(config.clouds.devstack.auth.auth_url + '/v2.0')
19
-      .then(testKeystone)
20
-      .catch(failTest);
21
-  });
22
-
23
-});

+ 0
- 32
test/unit/indexTest.js View File

@@ -1,32 +0,0 @@
1
-import Test from "../../src/index";
2
-
3
-const FetchMock = require('fetch-mock');
4
-
5
-describe("Simple test", () => {
6
-
7
-  afterEach(() => {
8
-    FetchMock.reset();
9
-  });
10
-
11
-  it("should export a class", () => {
12
-    let t = new Test();
13
-    expect(t).toBeDefined();
14
-  });
15
-
16
-  it("should retrieve URL's", (done) => {
17
-    FetchMock.get("http://example.com/", {
18
-      status: 200,
19
-      body: "This is a test"
20
-    });
21
-
22
-    let t = new Test();
23
-    t.getUrl("http://example.com/")
24
-      .then((response) => {
25
-        return response.text();
26
-      })
27
-      .then((body) => {
28
-        expect(body).toEqual("This is a test");
29
-        done();
30
-      });
31
-  });
32
-});

Loading…
Cancel
Save