message: Moves tests around ready for until testing of errors
diff: @@ -8,6 +8,9 @@ import { OAuthClient } from '../../OAuthClient';
  import { InMemoryOAuth } from './InMenoryOAuth';
  import { createSingleInvoiceRequest } from './request-examples/invoice.request.examples';
  +const privateKeyFile = path.resolve(__dirname + '/test-privatekey.pem');
  +const privateKey = fs.readFileSync(privateKeyFile, 'utf8');
  +
  describe('/invoices', () => {
  describe('and getting', () => {
  describe('multiple invoices', () => {
  @@ -15,10 +18,6 @@ describe('/invoices', () => {
  const inMemoryOAuth = new InMemoryOAuth();
  beforeAll(async () => {
  -
  - const privateKeyFile = path.resolve(__dirname + '/test-privatekey.pem');
  - const privateKey = fs.readFileSync(privateKeyFile, 'utf8');
  -
  inMemoryOAuth.callbackResultsForNextCall(null, JSON.stringify(multipleInvoices), { statusCode: 200 });
  const xeroClient = new XeroAPIClient({
  @@ -55,15 +54,12 @@ describe('/invoices', () => {
  });
  describe('and creating', () => {
  - // TODO: This test actually mocks out the oauth lib and therefore runs all our code. We should migrate all tests to this?
  + describe('a single invoice', () => {
  + describe('successfully', () => {
  let result: InvoicesResponse;
  const inMemoryOAuth = new InMemoryOAuth();
  beforeAll(async () => {
  -
  - const privateKeyFile = path.resolve(__dirname + '/test-privatekey.pem');
  - const privateKey = fs.readFileSync(privateKeyFile, 'utf8');
  -
  inMemoryOAuth.callbackResultsForNextCall(null, JSON.stringify(singleInvoice), 201);
  const xeroClient = new XeroAPIClient({
  @@ -96,4 +92,9 @@ describe('/invoices', () => {
  inMemoryOAuth.lastCalledThisURL('https://api.xero.com/api.xro/2.0/invoices?summarizeErrors=false');
  });
  });
  +
  + // TODO: Here.
  + describe('unsuccessfully', () => {});
  + });
  + });
  });
  