import { Application } from 'express';
import { createServer } from '../src/server';
import * as request from 'supertest';

describe('routes', () => {
    let app: Application;

    before('create app', function() {
        app = createServer();
    });

    describe('GET /api', () => {
        it('should redirect to the docs on GitHub', () =>
            request(app)
                .get('/api')
                .expect(302)
                .expect('Location', /github\.com/)
        );
    });
});

import { Application } from 'express';
import { createServer } from '../src/server';
import * as request from 'supertest';

describe('routes', () => {
    let app: Application;

    before('create app', function() {
        app = createServer();
    });

    describe('GET /api', () => {
        it('should redirect to the docs on GitHub', () =>
            request(app)
                .get('/api')
                .expect(301)
                .expect('Location', /github\.com/)
        );
    });
});

--- 
+++ 
@@ -13,7 +13,7 @@
         it('should redirect to the docs on GitHub', () =>
             request(app)
                 .get('/api')
-                .expect(301)
+                .expect(302)
                 .expect('Location', /github\.com/)
         );
     });
Fix status code for redirect
