Пример #1
0
  test('handles bundle tagged-template literals in ES5', async () => {
    const tmpDir = tmp.dirSync();
    copyDir(
        path.join(fixturePath, 'build-with-tagged-template-literals', 'source'),
        tmpDir.name);

    await runCommand(binPath, ['build'], {
      cwd: tmpDir.name,
    });

    const filename =
        path.join(tmpDir.name, 'build', 'es5-bundled', 'my-app.html');
    const contents = fs.readFileSync(filename, 'utf-8');
    // assert contents contain _templateObject with UUID suffix
    assert.match(
        contents,
        /_templateObject\d*_[A-Fa-f0-9]+\s*=/g,
        'build output does not contain modified _templateObject names');
    // assert contents don't contain unmodified "_templateObject" variable
    assert.notMatch(
        contents,
        /_templateObject\d*\s*=/g,
        'build output contains unmodified _templateObject names');
  });
Пример #2
0
		it('should return no trailing slash', () => {
			urls = new git.GithubRepo({repoOwner:'foo', repoProject: 'bar'}, 'baz', gitTest.opts).urls;
			assert.notMatch(urls.apiBranches(), /\/$/, 'apiBranches');
			assert.notMatch(urls.apiBranch('abc'), /\/$/, 'apiBranch');
		});
 it('shouldn\'t append custom node into the obfuscated code', () => {
     assert.notMatch(obfuscatedCode, regExp);
 });
 it('shouldn\'t add `control flow storage` node to the obfuscated code', () => {
     assert.notMatch(obfuscatedCode, controlFlowStorageRegExp);
 });
 it('match #3: shouldn\'t append custom node into the obfuscated code', () => {
     assert.notMatch(obfuscatedCode, consoleWarnRegExp);
 });