import chai from 'chai';
const expect = chai.expect;
import onlyJsFiles from '../../src/resources/onlyJsFiles.js';

describe('test onlyJsFiles', function() {
  it('should return only JS files', () => {
    const resources = [
      'https://example.com/jQuery.js',
      'https://example.com/js/somejsfile.js',
      'https://example.com/css/main.css',
      'https://example.com/images/image.jpeg',
      'https://example.com/js/subfolder/file.js',
      'https://example.com/js/subfolder/file.js?v=1.0.0',
      'https://example.com/js/subfolder/file.js?whatever',
      'https://example.com/js/subfolder/file.min.js?whatever',
    ];
    const files = onlyJsFiles(resources);

    expect(files).to.deep.equal([
      'https://example.com/jQuery.js',
      'https://example.com/js/somejsfile.js',
      'https://example.com/js/subfolder/file.js',
      'https://example.com/js/subfolder/file.js?v=1.0.0',
      'https://example.com/js/subfolder/file.js?whatever',
      'https://example.com/js/subfolder/file.min.js?whatever',
    ]);
  });
});

import chai from 'chai';
const expect = chai.expect;
import onlyJsFiles from '../../src/resources/onlyJsFiles.js';

describe('test onlyJsFiles', function() {
  it('should return only JS files', () => {
    const resources = [
      'https://example.com/jQuery.js',
      'https://example.com/js/somejsfile.js',
      'https://example.com/css/main.css',
      'https://example.com/images/image.jpeg',
      'https://example.com/js/subfolder/file.js',
      'https://example.com/js/subfolder/file.js?v=1.0.0',
      'https://example.com/js/subfolder/file.js?version=1.0.0',
      'https://example.com/js/subfolder/file.js?whatever',
      'https://example.com/js/subfolder/file.min.js?whatever',
    ];
    const files = onlyJsFiles(resources);

    expect(files).to.deep.equal([
      'https://example.com/jQuery.js',
      'https://example.com/js/somejsfile.js',
      'https://example.com/js/subfolder/file.js',
      'https://example.com/js/subfolder/file.js?v=1.0.0',
      'https://example.com/js/subfolder/file.js?whatever',
      'https://example.com/js/subfolder/file.min.js?whatever',
    ]);
  });
});

Add new test case for JS files
Add new test case for JS files
