Skip to content

Commit

Permalink
Add WIP test
Browse files Browse the repository at this point in the history
  • Loading branch information
marcofugaro committed Mar 7, 2019
1 parent c141fd2 commit 6da3535
Show file tree
Hide file tree
Showing 2 changed files with 13 additions and 0 deletions.
12 changes: 12 additions & 0 deletions test/ContentBase.test.js
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
'use strict';

const path = require('path');
const fs = require('fs');
const request = require('supertest');
const helper = require('./helper');
const config = require('./fixtures/contentbase-config/webpack.config');
Expand Down Expand Up @@ -38,6 +39,17 @@ describe('ContentBase', () => {
it('Request to other file', (done) => {
req.get('/other.html').expect(200, /Other html/, done);
});

it('Watches recursively', (done) => {
const nestedFile = path.join(contentBasePublic, 'assets/example.txt');

fs.truncateSync(nestedFile);
fs.writeFileSync(nestedFile, 'Heyo', 'utf8');

// TODO check if the browser has refreshed

done();
});
});

describe('to directories', () => {
Expand Down
1 change: 1 addition & 0 deletions test/fixtures/contentbase-config/public/assets/example.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
Heyo

0 comments on commit 6da3535

Please sign in to comment.