Skip to content

Commit

Permalink
refactor: cleanup examples/parcel spec to use runfiles helper instead…
Browse files Browse the repository at this point in the history
… of absolute require (#1808)
  • Loading branch information
gregmagolan authored Apr 9, 2020
1 parent ff0369c commit aa9348b
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions examples/parcel/parcel.spec.js
Original file line number Diff line number Diff line change
@@ -1,10 +1,11 @@
const fs = require('fs');
const runfiles = require(process.env['BAZEL_NODE_RUNFILES_HELPER']);

describe('bundling', () => {
it('should work', () => {
let written;
console.log = (m) => written = m;
const bundle = require('examples_parcel/bundle.js');
const bundlePath = runfiles.resolveWorkspaceRelative('bundle.js');
require(bundlePath);
expect(written).toEqual('Hello, Bob');
});
});

0 comments on commit aa9348b

Please sign in to comment.