Beispiel #1
0
        public void ThrowsOnOtherEntryPoint()
        {
            var parser = new AssetManifestParser(new OptionsWrapper <WebpackTagOptions>(new WebpackTagOptions()));
            var result = parser.ParseManifest(Fixture1);

            Assert.Throws <ArgumentException>(() => result.GetPaths("js", "foobar"));
        }
Beispiel #2
0
        public void ParsesAssetManifest()
        {
            var parser = new AssetManifestParser(new OptionsWrapper <WebpackTagOptions>(new WebpackTagOptions()));
            var result = parser.ParseManifest(Fixture1);

            var jsPaths = result.GetPaths("js");

            Assert.Equal(new[]
            {
                "/static/js/runtime-main.d1ae9948.js",
                "/static/js/2.a6664501.chunk.js",
                "/static/js/main.a7ba1e53.chunk.js"
            }, jsPaths);

            var cssPaths = result.GetPaths("css");

            Assert.Equal(new[]
            {
                "/static/css/2.833dd627.chunk.css",
                "/static/css/main.13b298a8.chunk.css",
            }, cssPaths);

            var fooPaths = result.GetPaths("foo");

            Assert.Empty(fooPaths);
        }
Beispiel #3
0
        public void PrependsPath()
        {
            var parser = new AssetManifestParser(new OptionsWrapper <WebpackTagOptions>(new WebpackTagOptions
            {
                BaseUrl = "https://cdn.example.com/"
            }));
            var result = parser.ParseManifest(Fixture1);

            var jsPaths = result.GetPaths("js");

            Assert.Equal(new[]
            {
                "https://cdn.example.com/static/js/runtime-main.d1ae9948.js",
                "https://cdn.example.com/static/js/2.a6664501.chunk.js",
                "https://cdn.example.com/static/js/main.a7ba1e53.chunk.js"
            }, jsPaths);
        }