<commit_before>import { setupQunit } from '@pollyjs/core';

export function setupPolly(hooks, options = {}) {
  setupQunit(hooks, options);

  hooks.beforeEach(function() {
    let { server } = this.polly;

    server.get('/_percy/:anything').passthrough();

    server.get('/translations/:locale.json').passthrough();

    server.get('/api/locale').intercept((req, res) => {<commit_msg>Polly: Rewrite API requests to https://skylines.aero<commit_after>import { setupQunit } from '@pollyjs/core';

export function setupPolly(hooks, options = {}) {
  setupQunit(hooks, options);

  hooks.beforeEach(function() {
    let { server } = this.polly;

    server.any().on('request', req => {
      if (req.url.startsWith('/api')) {
        req.url = `https://skylines.aero${req.url}`;
      }
    });

    server.get('/_percy/:anything').passthrough();

    server.get('/translations/:locale.json').passthrough();

    server.get('/api/locale').intercept((req, res) => {
{'fraction_non_alphanumeric': 0.1921079958463136, 'fraction_numerical': 0.0, 'mean_word_length': 3.8686868686868685, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 6, 'https://': 2, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '7039088', 'n_tokens_mistral': 326, 'n_tokens_neox': 327, 'n_words': 47}