Skip to content

Commit

Permalink
test: don't detect requires in test in minified
Browse files Browse the repository at this point in the history
  • Loading branch information
markwhitfeld committed Apr 29, 2022
1 parent 457f5b7 commit 21a6cde
Show file tree
Hide file tree
Showing 2 changed files with 39 additions and 0 deletions.
19 changes: 19 additions & 0 deletions test/test.js
Original file line number Diff line number Diff line change
@@ -1,5 +1,7 @@
"format global";

var assert = require('assert');

suite('SystemJS Standard Tests', function() {

function ok(assertion, message) {
Expand Down Expand Up @@ -637,6 +639,23 @@ suite('SystemJS Standard Tests', function() {
});
});

test('CommonJS require variations in minified files', function () {
return System.import('tests/commonjs-minified-requires.js').then(function (m) {
assert.equal(m.d0, 'd6');
assert.equal(m.d1, 'd');
assert.equal(m.d2, 'd');
assert.equal(m.d3, "require('not a dep')");
assert.equal(m.d4, "text/* require('still not a dep') text");
assert.equal(m.d5, 'text \'quote\' require("yet still not a dep")');
assert.equal(m.d6, `in single quoted text require("also not a dep 1")`);
assert.equal(m.d6a, 'd');
assert.equal(m.d7, `in double quoted text require('also not a dep 2')`);
assert.equal(m.d7a, 'd');
assert.equal(m.d8, 'd');
assert.equal(m.d9, 'end');
});
});

test('CommonJS globals', function () {
System.config({
meta: {
Expand Down
20 changes: 20 additions & 0 deletions test/tests/commonjs-minified-requires.js

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

0 comments on commit 21a6cde

Please sign in to comment.