Skip to content

Instantly share code, notes, and snippets.

@gnschenker
Created December 30, 2019 13:11
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save gnschenker/ff804268d2744acf538fbb6d4de46b42 to your computer and use it in GitHub Desktop.
Save gnschenker/ff804268d2744acf538fbb6d4de46b42 to your computer and use it in GitHub Desktop.
First outside-in test
describe("Suite to test the glossary API", () => {
const https = require('https');
const httpsAgent = new https.Agent({ rejectUnauthorized: false });
const axios = require('axios');
const baseUrl = `https://localhost:5001/api`;
const client = axios.create({
baseURL: baseUrl,
httpsAgent
})
describe("when calling /glossary", () => {
it("should return list of glossaries", async () => {
const response = await client.get('glossary');
expect(response.status).toBe(200);
expect(response.data.length).toBeGreaterThan(0);
expect(response.data[0].term).toBe('AccessToken');
})
});
});
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment