From 0445f0dd99f1359372ea3619e97adf21cc8fa4d9 Mon Sep 17 00:00:00 2001 From: Jason Bedard Date: Fri, 29 Nov 2019 22:53:45 -0800 Subject: [PATCH] refactor(test): update spec naming --- test/spec.js | 16 ++++++++-------- 1 file changed, 8 insertions(+), 8 deletions(-) diff --git a/test/spec.js b/test/spec.js index 7e5c56e..74de4e6 100644 --- a/test/spec.js +++ b/test/spec.js @@ -13,25 +13,25 @@ describe('HTML inserter', () => { output = content; } - it('should do be a no-op', () => { + it('should noop when no assets', () => { expect(main(["--out", outFile, "--html", inFile,], read, write)).toBe(0); expect(output).toBe(''); }); - it('should inject script tag', () => { + it('should inject .js as script tag', () => { expect(main(["--out", outFile, "--html", inFile, '--assets', 'path/to/my.js'], read, write, () => 123)).toBe(0); expect(output).toBe( ''); }); - it('should allow the "module js" extension', () => { + it('should assume "module js" .mjs extension is type="module"', () => { expect(main(["--out", outFile, "--html", inFile, '--assets', 'path/to/my.mjs'], read, write, () => 123)) .toBe(0); expect(output).toBe( ''); }); - it('should allow the ".es2015.js" extension', () => { + it('should allow the ".es2015.js" extension is type="module"', () => { expect(main( ["--out", outFile, "--html", inFile, '--assets', 'path/to/my.es2015.js'], read, write, () => 123)) .toBe(0); @@ -39,14 +39,14 @@ describe('HTML inserter', () => { ''); }); - it('should include --out file dir as default --root', () => { + it('should include --out file dir as a default --root', () => { expect(main(["--out", outFile, "--html", inFile, '--assets', 'out/some/file.js'], read, write, () => 123)).toBe(0); expect(output).toBe( ''); }); - it('should strip longest prefix', () => { + it('should strip the longest matching prefix', () => { expect(main(["--out", outFile, "--html", inFile, "--roots", 'path', 'path/to', '--assets', 'path/to/my.js'], read, write, () => 123)).toBe(0); @@ -54,7 +54,7 @@ describe('HTML inserter', () => { ''); }); - it('should strip external workspaces', () => { + it('should strip the external workspaces prefix', () => { expect(main(["--out", outFile, "--html", inFile, "--roots", 'npm/node_modules/zone.js/dist', '--assets', 'external/npm/node_modules/zone.js/dist/zone.min.js'], read, write, () => 123)).toBe(0); @@ -63,7 +63,7 @@ describe('HTML inserter', () => { }); - it('should inject link tag', () => { + it('should inject .css files as stylesheet link tags', () => { expect(main(["--out", outFile, "--html", inFile, '--assets', 'path/to/my.css'], read, write, () => 123)).toBe(0); expect(output).toBe( '');