@rstest/core 0.9.4 → 0.9.6

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (52) hide show
  1. package/LICENSE.md +54 -202
  2. package/dist/0~8843.js +32 -14
  3. package/dist/{0~lib.js → 0~@babel/code-frame.js} +2 -2
  4. package/dist/0~@clack/prompts.js +1044 -0
  5. package/dist/0~browserLoader.js +1 -1
  6. package/dist/0~browser~1.js +19 -19
  7. package/dist/0~checkThresholds.js +2 -2
  8. package/dist/0~chokidar.js +43 -42
  9. package/dist/0~console.js +1 -1
  10. package/dist/0~fake-timers.js +1586 -0
  11. package/dist/0~generate.js +5 -5
  12. package/dist/0~happyDom.js +1 -1
  13. package/dist/0~jsdom.js +1 -1
  14. package/dist/0~listTests.js +3 -3
  15. package/dist/0~loadModule.js +1 -1
  16. package/dist/0~magic-string.es.js +1 -181
  17. package/dist/0~restart.js +1 -1
  18. package/dist/0~runTests.js +11 -4
  19. package/dist/0~snapshot.js +2140 -0
  20. package/dist/0~snapshot.js.LICENSE.txt +7 -0
  21. package/dist/0~utils.js +1 -1
  22. package/dist/1255.js +11 -11
  23. package/dist/1949.js +2919 -9808
  24. package/dist/1949.js.LICENSE.txt +1 -49
  25. package/dist/3145.js +415 -40
  26. package/dist/4411.js +245 -60
  27. package/dist/6830.js +62 -10
  28. package/dist/6887.js +15 -0
  29. package/dist/7552.js +22 -4918
  30. package/dist/9743.js +1982 -0
  31. package/dist/9784.js +1343 -0
  32. package/dist/{7552.js.LICENSE.txt → 9784.js.LICENSE.txt} +19 -8
  33. package/dist/browser-runtime/2~fake-timers.js +1760 -0
  34. package/dist/browser-runtime/2~magic-string.es.js +3 -189
  35. package/dist/browser-runtime/2~snapshot.js +2138 -0
  36. package/dist/browser-runtime/2~snapshot.js.LICENSE.txt +7 -0
  37. package/dist/browser-runtime/723.js +1818 -10300
  38. package/dist/browser-runtime/723.js.LICENSE.txt +0 -17
  39. package/dist/browser-runtime/index.d.ts +205 -16
  40. package/dist/browser.d.ts +55 -10
  41. package/dist/browser.js +2 -2
  42. package/dist/globalSetupWorker.js +2 -2
  43. package/dist/index.d.ts +78 -16
  44. package/dist/index.js +1 -1
  45. package/dist/mockRuntimeCode.js +2 -0
  46. package/dist/worker.d.ts +47 -10
  47. package/dist/worker.js +12 -10
  48. package/package.json +27 -28
  49. package/dist/0~dist.js +0 -1014
  50. package/dist/4899.js +0 -11
  51. package/dist/browser-runtime/rslib-runtime.js +0 -56
  52. /package/dist/{rslib-runtime.js → 0~rslib-runtime.js} +0 -0
@@ -1,12 +1,5 @@
1
- import { __webpack_require__ } from "./rslib-runtime.js";
1
+ import { __webpack_require__ } from "./723.js";
2
2
  import "./723.js";
3
- var magic_string_es_namespaceObject = {};
4
- __webpack_require__.r(magic_string_es_namespaceObject);
5
- __webpack_require__.d(magic_string_es_namespaceObject, {
6
- Bundle: ()=>Bundle,
7
- SourceMap: ()=>SourceMap,
8
- default: ()=>MagicString
9
- });
10
3
  var Buffer = __webpack_require__("../../node_modules/.pnpm/buffer@5.7.1/node_modules/buffer/index.js")["Buffer"];
11
4
  var comma = ",".charCodeAt(0);
12
5
  var semicolon = ";".charCodeAt(0);
@@ -1033,184 +1026,5 @@ class MagicString {
1033
1026
  return this._replaceRegexp(searchValue, replacement);
1034
1027
  }
1035
1028
  }
1036
- const hasOwnProp = Object.prototype.hasOwnProperty;
1037
- class Bundle {
1038
- constructor(options = {}){
1039
- this.intro = options.intro || '';
1040
- this.separator = void 0 !== options.separator ? options.separator : '\n';
1041
- this.sources = [];
1042
- this.uniqueSources = [];
1043
- this.uniqueSourceIndexByFilename = {};
1044
- }
1045
- addSource(source) {
1046
- if (source instanceof MagicString) return this.addSource({
1047
- content: source,
1048
- filename: source.filename,
1049
- separator: this.separator
1050
- });
1051
- if (!isObject(source) || !source.content) throw new Error('bundle.addSource() takes an object with a `content` property, which should be an instance of MagicString, and an optional `filename`');
1052
- [
1053
- 'filename',
1054
- 'ignoreList',
1055
- 'indentExclusionRanges',
1056
- 'separator'
1057
- ].forEach((option)=>{
1058
- if (!hasOwnProp.call(source, option)) source[option] = source.content[option];
1059
- });
1060
- if (void 0 === source.separator) source.separator = this.separator;
1061
- if (source.filename) if (hasOwnProp.call(this.uniqueSourceIndexByFilename, source.filename)) {
1062
- const uniqueSource = this.uniqueSources[this.uniqueSourceIndexByFilename[source.filename]];
1063
- if (source.content.original !== uniqueSource.content) throw new Error(`Illegal source: same filename (${source.filename}), different contents`);
1064
- } else {
1065
- this.uniqueSourceIndexByFilename[source.filename] = this.uniqueSources.length;
1066
- this.uniqueSources.push({
1067
- filename: source.filename,
1068
- content: source.content.original
1069
- });
1070
- }
1071
- this.sources.push(source);
1072
- return this;
1073
- }
1074
- append(str, options) {
1075
- this.addSource({
1076
- content: new MagicString(str),
1077
- separator: options && options.separator || ''
1078
- });
1079
- return this;
1080
- }
1081
- clone() {
1082
- const bundle = new Bundle({
1083
- intro: this.intro,
1084
- separator: this.separator
1085
- });
1086
- this.sources.forEach((source)=>{
1087
- bundle.addSource({
1088
- filename: source.filename,
1089
- content: source.content.clone(),
1090
- separator: source.separator
1091
- });
1092
- });
1093
- return bundle;
1094
- }
1095
- generateDecodedMap(options = {}) {
1096
- const names = [];
1097
- let x_google_ignoreList;
1098
- this.sources.forEach((source)=>{
1099
- Object.keys(source.content.storedNames).forEach((name)=>{
1100
- if (!~names.indexOf(name)) names.push(name);
1101
- });
1102
- });
1103
- const mappings = new Mappings(options.hires);
1104
- if (this.intro) mappings.advance(this.intro);
1105
- this.sources.forEach((source, i)=>{
1106
- if (i > 0) mappings.advance(this.separator);
1107
- const sourceIndex = source.filename ? this.uniqueSourceIndexByFilename[source.filename] : -1;
1108
- const magicString = source.content;
1109
- const locate = getLocator(magicString.original);
1110
- if (magicString.intro) mappings.advance(magicString.intro);
1111
- magicString.firstChunk.eachNext((chunk)=>{
1112
- const loc = locate(chunk.start);
1113
- if (chunk.intro.length) mappings.advance(chunk.intro);
1114
- if (source.filename) if (chunk.edited) mappings.addEdit(sourceIndex, chunk.content, loc, chunk.storeName ? names.indexOf(chunk.original) : -1);
1115
- else mappings.addUneditedChunk(sourceIndex, chunk, magicString.original, loc, magicString.sourcemapLocations);
1116
- else mappings.advance(chunk.content);
1117
- if (chunk.outro.length) mappings.advance(chunk.outro);
1118
- });
1119
- if (magicString.outro) mappings.advance(magicString.outro);
1120
- if (source.ignoreList && -1 !== sourceIndex) {
1121
- if (void 0 === x_google_ignoreList) x_google_ignoreList = [];
1122
- x_google_ignoreList.push(sourceIndex);
1123
- }
1124
- });
1125
- return {
1126
- file: options.file ? options.file.split(/[/\\]/).pop() : void 0,
1127
- sources: this.uniqueSources.map((source)=>options.file ? getRelativePath(options.file, source.filename) : source.filename),
1128
- sourcesContent: this.uniqueSources.map((source)=>options.includeContent ? source.content : null),
1129
- names,
1130
- mappings: mappings.raw,
1131
- x_google_ignoreList
1132
- };
1133
- }
1134
- generateMap(options) {
1135
- return new SourceMap(this.generateDecodedMap(options));
1136
- }
1137
- getIndentString() {
1138
- const indentStringCounts = {};
1139
- this.sources.forEach((source)=>{
1140
- const indentStr = source.content._getRawIndentString();
1141
- if (null === indentStr) return;
1142
- if (!indentStringCounts[indentStr]) indentStringCounts[indentStr] = 0;
1143
- indentStringCounts[indentStr] += 1;
1144
- });
1145
- return Object.keys(indentStringCounts).sort((a, b)=>indentStringCounts[a] - indentStringCounts[b])[0] || '\t';
1146
- }
1147
- indent(indentStr) {
1148
- if (!arguments.length) indentStr = this.getIndentString();
1149
- if ('' === indentStr) return this;
1150
- let trailingNewline = !this.intro || '\n' === this.intro.slice(-1);
1151
- this.sources.forEach((source, i)=>{
1152
- const separator = void 0 !== source.separator ? source.separator : this.separator;
1153
- const indentStart = trailingNewline || i > 0 && /\r?\n$/.test(separator);
1154
- source.content.indent(indentStr, {
1155
- exclude: source.indentExclusionRanges,
1156
- indentStart
1157
- });
1158
- trailingNewline = '\n' === source.content.lastChar();
1159
- });
1160
- if (this.intro) this.intro = indentStr + this.intro.replace(/^[^\n]/gm, (match, index)=>index > 0 ? indentStr + match : match);
1161
- return this;
1162
- }
1163
- prepend(str) {
1164
- this.intro = str + this.intro;
1165
- return this;
1166
- }
1167
- toString() {
1168
- const body = this.sources.map((source, i)=>{
1169
- const separator = void 0 !== source.separator ? source.separator : this.separator;
1170
- const str = (i > 0 ? separator : '') + source.content.toString();
1171
- return str;
1172
- }).join('');
1173
- return this.intro + body;
1174
- }
1175
- isEmpty() {
1176
- if (this.intro.length && this.intro.trim()) return false;
1177
- if (this.sources.some((source)=>!source.content.isEmpty())) return false;
1178
- return true;
1179
- }
1180
- length() {
1181
- return this.sources.reduce((length, source)=>length + source.content.length(), this.intro.length);
1182
- }
1183
- trimLines() {
1184
- return this.trim('[\\r\\n]');
1185
- }
1186
- trim(charType) {
1187
- return this.trimStart(charType).trimEnd(charType);
1188
- }
1189
- trimStart(charType) {
1190
- const rx = new RegExp('^' + (charType || '\\s') + '+');
1191
- this.intro = this.intro.replace(rx, '');
1192
- if (!this.intro) {
1193
- let source;
1194
- let i = 0;
1195
- do {
1196
- source = this.sources[i++];
1197
- if (!source) break;
1198
- }while (!source.content.trimStartAborted(charType))
1199
- }
1200
- return this;
1201
- }
1202
- trimEnd(charType) {
1203
- const rx = new RegExp((charType || '\\s') + '+$');
1204
- let source;
1205
- let i = this.sources.length - 1;
1206
- do {
1207
- source = this.sources[i--];
1208
- if (!source) {
1209
- this.intro = this.intro.replace(rx, '');
1210
- break;
1211
- }
1212
- }while (!source.content.trimEndAborted(charType))
1213
- return this;
1214
- }
1215
- }
1216
- export { magic_string_es_namespaceObject };
1029
+ Object.prototype.hasOwnProperty;
1030
+ export default MagicString;