Merge "Export supported services from index.js"

This commit is contained in:
Jenkins 2016-09-23 16:25:48 +00:00 committed by Gerrit Code Review
commit 3221a3513d
3 changed files with 2 additions and 65 deletions

View File

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

View File

@ -1,23 +0,0 @@
import Test from "../../src/index";
import config from "./helpers/cloudsConfig";
describe("Simple functional test", () => {
it("should call keystone URL", (done) => {
const testKeystone = function(response) {
expect(response.status).toBe(200);
done();
};
const failTest = function(error) {
expect(error).toBeUndefined();
done();
};
const t = new Test();
t.getUrl(config.clouds.devstack.auth.auth_url + '/v2.0')
.then(testKeystone)
.catch(failTest);
});
});

View File

@ -1,32 +0,0 @@
import Test from "../../src/index";
const FetchMock = require('fetch-mock');
describe("Simple test", () => {
afterEach(() => {
FetchMock.reset();
});
it("should export a class", () => {
let t = new Test();
expect(t).toBeDefined();
});
it("should retrieve URL's", (done) => {
FetchMock.get("http://example.com/", {
status: 200,
body: "This is a test"
});
let t = new Test();
t.getUrl("http://example.com/")
.then((response) => {
return response.text();
})
.then((body) => {
expect(body).toEqual("This is a test");
done();
});
});
});