Browse Source

Add normalize-absolute test

ghi-672
Bogdan Chadkin 9 years ago
parent
commit
2b13d59ee4
  1. 15
      test/form/absolute-path-resolver/_config.js
  2. 10
      test/form/absolute-path-resolver/_expected/amd.js
  3. 8
      test/form/absolute-path-resolver/_expected/cjs.js
  4. 6
      test/form/absolute-path-resolver/_expected/es6.js
  5. 11
      test/form/absolute-path-resolver/_expected/iife.js
  6. 14
      test/form/absolute-path-resolver/_expected/umd.js
  7. 3
      test/form/absolute-path-resolver/a.js
  8. 4
      test/form/absolute-path-resolver/main.js

15
test/form/absolute-path-resolver/_config.js

@ -0,0 +1,15 @@
var path = require('path');
module.exports = {
solo: true,
description: 'normalizes absolute ids',
options: {
plugins: [{
transform: function (code, id) {
if (/main/.test(id)) {
return code.replace('"./a.js"', JSON.stringify(path.resolve(__dirname, 'a.js')));
}
}
}]
}
};

10
test/form/absolute-path-resolver/_expected/amd.js

@ -0,0 +1,10 @@
define(function () { 'use strict';
var a = () => {
console.log('props');
};
a();
a();
});

8
test/form/absolute-path-resolver/_expected/cjs.js

@ -0,0 +1,8 @@
'use strict';
var a = () => {
console.log('props');
};
a();
a();

6
test/form/absolute-path-resolver/_expected/es6.js

@ -0,0 +1,6 @@
var a = () => {
console.log('props');
};
a();
a();

11
test/form/absolute-path-resolver/_expected/iife.js

@ -0,0 +1,11 @@
(function () {
'use strict';
var a = () => {
console.log('props');
};
a();
a();
}());

14
test/form/absolute-path-resolver/_expected/umd.js

@ -0,0 +1,14 @@
(function (global, factory) {
typeof exports === 'object' && typeof module !== 'undefined' ? factory() :
typeof define === 'function' && define.amd ? define(factory) :
(factory());
}(this, function () { 'use strict';
var a = () => {
console.log('props');
};
a();
a();
}));

3
test/form/absolute-path-resolver/a.js

@ -0,0 +1,3 @@
export var a = () => {
console.log('props');
};

4
test/form/absolute-path-resolver/main.js

@ -0,0 +1,4 @@
import { a } from "./a.js";
import { a as b } from "./a.js";
a();
b();
Loading…
Cancel
Save